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.