Hi Zorden,
Check these links:
I think you are trying to update the Incident Resolution entity resolution field with the Solution ID on Case, not update the Case before Close, right?
If you want to Update Case before Close then you can use this:
nickhollis.blogspot.com/.../crm-2011-plugin-to-update-case-incident.html
By Default the Resolution field is a mandatory field and you cannot customize this, there is no way to embed a script form onload when resolution case form is opened onload
There are several ways workaround to do:
1. What you can do is "customize" the Resolution Case for by replacing it to new UI
www.powerobjects.com/.../use-a-dialog-process-in-microsoft-dynamics-crm-to-replace-the-case-resolution-form
2. Or you can use a custom dialog and then you close the Case using this code:
msdn.microsoft.com/.../hh547422.aspx
3. I haven't tried, but maybe you can try to change the Resolution field from IncidentResolution entity using a Plugin onCreate (Pre) of IncidentResolution.
The name of the resolution field is Subject
maybe you can replace using this code:
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
//create entity context
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName != "incidentresolution")
{
return;
}
try
{
entity["subject"] = "replace this with your dynamic case resolution field value";
}
}
But again, it will not give you a pre-filled Resolution field, instead, it will update later.
You can append as well
string strFormerSubject = entity["subject"];
entity["subject"] = String.Format("{0} - {1}", strFormerSubject, "replace this with your dynamic case resolution field value");
To get your related Case Id you can check the attribute: incidentid.
And you can get the value of the resolution field in the case (I guess it is a custom field, is it??) using service.Retrieve to get the related case by Id you found from related incidentid.
I hope this can help you!
Thanks.