Hi.
I am trying to assign to a link type field the value of another field of the same type programmatically.
With fields of type string, integer or decimal I have no problem:
string name = "Name";
decimal number = 1;
entity.Attributes["dv_name"] = name;
entity.Attributes["dv_quantity"] = number;
service.Update(entity);
But when I use I try to assign a link type field, it gives me an error. Lo he intentado de varias formas:
entity.Attributes["dv_uom"] = entity["uomid"];
or
EntityReference ref = (EntityReference)entity.Attributes["uomid"];
entity.Attributes["dv_uom"] = ref.Name;
I know I have to be doing it wrong, but I can't find how I should do it.
Greetings and thanks.
Thank you for letting us know the issue has been resolved.
I have already solved the problem. You can close the question.
Greetings and thanks.
Sorry. This topic should have been in the Microsoft Dynamics 365 CRM for Sales forum. How can I move it?
Sohail Ahmed
2,655
Mansi Soni
1,574
YUN ZHU
1,453
Super User 2025 Season 1