In one of my custom entity I need to set up a campaign entity, which is a look up in my custom entity. When I am trying to set this in plugin I am getting this query build error.
My code looks follows: It is getting the correct campaign, while saving the changes it is giving that error
Entity
entity = (Entity)pluginExecContext.InputParameters["Target"];
varcampaign = GetCampaignID();
EntityReferencecampaignRef =newEntityReference("Campaign", campaign.Id);
entity.Attributes.Add(
"cdi_campaignid", campaignRef);
orgServiceContext.SaveChanges();