Customization

MS CRM 2011: How to override standard dialogs

My client wanted to remove (or hide) “Total Time” and “Billable Time” fields in the Case Close dialog window:

Of course, I knew that it is possible to open the file CRM_Installation_Directory\CRM\Web\CS\cases\dlg_closecase.aspx, add several lines of code, and hide fields and labels; but this, the most obvious and easiest way out, had 2 disadvantages:
1. This solution is unsupported and it could be broken with new Rollups.
2. This solution does not work for CRM Online.
So I decided to solve this task using supported approaches.

Step 1. Create a new solution and put the Case entity inside:

Step 2. Write JavaScript that will do the same work as the original dialog does (the best way is to use SOAP Logger application to get correct request/response xml) and add it to the solution.
Step 3: Create the dialog to be used instead of a standard one and add it to solution. It should look like following:

Step 4: Remove the original “Close Case” and create a new “Close Case” button using Ribbon Customization. I usually do it using Ribbon Workbench:

 
 

Publish the changes that you’ve made. Demonstration:

 

45 Comments

  1. Good idea but I would suggest a simpler way. Create a CRM dialog and load that instead of the default dialog when the resolve button is pressed.

  2. Hello Syl,

    Thanks! I thought about suggested approach but one thing I was not able to do is dynamically fill optionset with status codes available for incident entity. Do you know how to do that?

    Kind regards,
    Andrii.

  3. Not sure doing it dynamically is worth it. Status Codes dont change that often.

    Still, you could do this in the js that launches the dialog :

    1) Check if the list of status codes changed.
    2) If so update a global option set on which your Resolve case Dialog is based.
    3) Launch your Resolve Case dialog.

    If for some reason this behavior is still desired then you would have to add some js code that fires before you load the Dialog and verifys if the list of status codes changed.

  4. You might also build a Custom Activity Workflow that would update the option set as the first step of your dialog.

  5. Hello Syl,

    You are right, dialog can be used but If I'm not wrong anyway you would not be able to create incident resolution activity that is created during closing of incident. So you would not be able to close incident with proper fields mapping like description, resolution and so on.

    Regarding custom workflow activity – at the moment it can be used but closing of incident would be done asynchronously and you will see the result only after some period of time.

    Kind regards,
    Andrii.

  6. Hello Mohammad,
    Your article looks great, but you've used a plugin in your functionality. I believe that task can be completed without this step. I have already done this before and I will publish article soon how to do that.

  7. Hello Andrii,
    I am getting an error when i am trying to import the solution.The error says the there are missing files which are : msa_partnercontactid of type field ,msa_contact_incident of type relationship,msa_contact_Incident of type relationship

    thanks a lot 🙂

  8. Hi! Perfect solution! Please, update link to solution, your one drive url contains only SureStep.exe. Thanks!

    1. Thank you, Kirill. Looks like that file is lost and I’m really sorry for that.

    1. Hello Angelia,
      It was a long time ago and I don’t think I have solution files anymore. I believe you came to this post from my reply of Dynamics forum. My goal was to give you waypoints to achieve your goal.
      Thanks,
      Andrew

  9. Hey Andrii, fantastic post, very informative and useful.
    I was wondering if you could answer one question I have regarding this process. In step 2, you suggest using SOAP Logger application as a way to replicate functionality of the original buttons Javascript. Do you know if there is another way to view and replicate the functionality of the OOB buttons JavaScript now in CE Online?
    I am trying to replicate most the OOB route button functionality but without the option to remove the item from the queue.
    Thank you,
    Zach

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.