Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Resolving a Case

Posted on by 170

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

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolving a Case

    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

    http://www.francescopicchi.com

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Resolving a Case

    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

    http://www.francescopicchi.com

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Resolving a Case

    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.

  • Suggested answer
    ARIFNIIT Profile Picture
    ARIFNIIT 1,391 on at
    RE: Resolving a Case

    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()  

  • Suggested answer
    chauhanhardik Profile Picture
    chauhanhardik 685 on at
    RE: Resolving a Case

    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

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Resolving a Case

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans