I understand why i am getting the error, but i cannot find a solution on how to get the attribute that i need in order to pass value to it, code sample of my work so far is bellow, any suggestions are welcomed.
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) { Entity entity = (Entity)context.InputParameters["Target"]; if (entity.LogicalName != Entity_Name) return; Entity productOffer = service.Retrieve(Entity_Name, entity.Id, new ColumnSet(true)); Entity vintage = service.Retrieve(Entity_Name, productOffer.GetAttributeValue<EntityReference>(Entity_Name).Id, new ColumnSet("new_netpriceperbottle", "transactioncurrencyid")); if (context.MessageName == "Update" ) { if (vintage.Contains("netpriceperbottle")) { vintage.Attributes["netpriceperbottle"] = productOffer.Attributes["new_netpriceperbottle"]; vintage.Attributes["transactioncurrencyid"] = productOffer.Attributes["transactioncurrencyid"]; service.Update(vintage); } }
*This post is locked for comments