Hi all..I have a small requirement.We have a custom button called Resolve. On Click of that case has to be Resolved. I have Written a custom code for it.
So on click of the button case is getting resolved. But the problem it is getting reflected only after form Refresh. Please give your suggestions. Below is the code i have used for resolving.
Entity caseResolution = new Entity("incidentresolution");
caseResolution["incidentid"] = new EntityReference("incident", caseId);
caseResolution["subject"] = "Case resolved!";
CloseIncidentRequest close = new CloseIncidentRequest();
close.IncidentResolution = caseResolution;
close.RequestName = "CloseIncident";
close.Status = new OptionSetValue(5);
CloseIncidentResponse closeCase = (CloseIncidentResponse)organizationService.Execute(close);
*This post is locked for comments
Hi Muthuraman,
if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco
If you found the answer helpful, please mark as Verified
Join my network on LinkedIn Follow me on Twitter
Thank You & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY
Independent Contractor
Hi Muthuraman,
proceed as follow:
1) add a new boolean attribute (we name it "new_resolve") to entity and form
2) set your plugin to trigger CloseIncident only when new_resolve attribute is true
3) when you click Resolve ribbon button, just set "new_resolve" as true ad save, so ...
4) ... plugin execute CloseIncident event and the form reload, without any further action!
Please let know if you solve
If you found the answer helpful, please mark as Verified
Join my network on LinkedIn Follow me on Twitter
Thank You & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY
Independent Contractor
Why don't you refresh your form using JS?
msdn.microsoft.com/.../dn481607.aspx
There are many options here, you must be more specific what exactly does your button, you only posted some fragment of a plugin, not the whole solution.
Create a custom Action and write this case resolve code into this action. Call this action using JavaScript. when you will get response from action in javaScript refresh your form data using Xrm.Page.data.refresh()
Hi Muthuraman,
You can refresh parent page(Case page) on close event of the pop-up window(case resolve page) by some javascript code which trigger the same action to refresh the parent page on closing of pop-up window.
Thanks,
Hardik Chauhan
Hi Muthuram144312,
How are you calling this code from your button. You won't be able to refeesh from server side code, you need to have some JavaScript ode to triter this is done to referesh the page.
Below is the JavaScript you can use-
msdn.microsoft.com/.../dn481607.aspx;MSPPError=-2147217396#BKMK_refresh
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156