thank first all to helping me, out I have got a big problem I trying to run a post operation plugin in crm 2013 I have got, to Entities One is "account" and the other one is "sales" My problem is : The filed in entities account is lookup filed And the filed in sales is text filed The value from the sales Test filed I have to add in the look up filed I have allready retrieve the value from the sales test field Only problem is I can’t add the value in the look up: get an error message.
0
votes
1 Answers
0
votes
It would be appreciated if you can share the error message which you are getting.
Assuming that you are trying to set the primary contact for the account, I would have coded as follows,
Entity account=new Entity("account"); account.Id=; account["primarycontactid"]=new EntityReference("contact",); service.Update(account);
In this case i again assume the text value which you have retrieved is a Guid value. If not, get that value from CRM using a service.Retrive() or service.RetrieveMultiple() methods and do it as above.
Hope this helps!!!.