I am making a plugin in CRM 2011. The plugin is taking data from the Entity's subgrid by using fetchXML, making some calculate with the data and at the end of the plugin I want to set the new calculated data back in the subgrid, but I can't ...
I tried few ways to do that like:
(1)
private static OptionSetValue CreateOptionSet(int optionSetValue)
{
OptionSetValue optionSetInstance = new OptionSetValue();
optionSetInstance.Value = optionSetValue;
return optionSetInstance;
}
(2)
public void setVal(Entity entity, string attr, object val)
{
if (entity.Attributes.Contains(attr))
{
entity[attr] = val;
}
else
{
entity.Attributes.Add(attr, val);
}
}
and just
paid["zbg_paidamount"] = 400;
payment.Attributes["zbg_suggestedamount"] = paidVal;
But nothing works...
I am thinking maybe is from the type of the data that I am trying to set but not sure.
Please if you can help me I am desperate.
Thanks