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:

 

40 Comments on “MS CRM 2011: How to override standard dialogs

  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. 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.

  5. 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.

  6. 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 🙂

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

Leave a Reply

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