One of the few elements of Microsoft Dynamics CRM 2011 that is not customizable is the Case Resolution form. It is also not accessible via workflow. If more case resolution information needed to be captured it typically needs to be entered on the case form and perhaps some JavaScript to dynamically set field requirements. Then when the user clicks to resolve the case they are prompted again.

In a recent implementation the user required the resolution to be populated on the case but didn't want to have to re-enter or copy and paste to the case resolution form.

MSCRM and Javascript

The out-of-the-box form has a text field for the resolution that was too minimal in many instances

One solution to this resolution conundrum is to create a Dialog to capture the information and replace the functionality of the 'Resolve Case' button.

 

I created a dialog that prompts for a 'Resolution'

In the next step I updated the Case, populating the Resolution on the case from the prompt response

Final step changes the status of the case to resolved

Now from a Case, click on the 'Dialogs' button and select the new Dialog

Respond to the prompt and complete the dialog

The dialog process populates the response in the designated field and the resolves the case

That's great, but let's take it another step and replace the function of the out-of-the-box 'Resolve Case' button.

Next I created a web resource for the JavaScript we'll use to launch the Dialog

The JavaScript opens a window and accepts the parameters we'll send from the ribbon customization
I also added a line to close the case record.

I also captured the GUID of the workflow. (Simply open the dialog, Ctrl+N reopens with the url)

Next create a solution, add the Case entity and export and extract the xml

Locate the Ribbon section and add a custom action. In my case I'm replacing the action of the existing Resolve Case button. If you want to add a custom button check out this blog post

Here is the code. The important element is the JavaScriptFunction – here I call the web resource and for the first parameter paste in the GUID of the Dialog:

</p>
<RibbonDiffXml>
  <CustomActions>
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="Mscrm.Form.incident.Resolve">
      <EnableRules>
        </EnableRules>
      <DisplayRules>
        <DisplayRule Id="Mscrm.CanChangeIncidentForm" />
        <DisplayRule Id="Mscrm.IncidentIsActive" />
      </DisplayRules>
      <Actions>
        <JavaScriptFunction FunctionName="ResolveCaseDialog" Library="$webresource:new_ResolveCaseDialog" >
          <!-- dialogID, typeName, recordId -->
          <StringParameter Value="60E0A113-2C90-44D6-8839-A9F4F6A115BC" />
          <StringParameter Value="incident" />
          <CrmParameter Value="FirstPrimaryItemId" />
        </JavaScriptFunction>
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules />
    <EnableRules />
  </RuleDefinitions>
  <LocLabels />
</RibbonDiffXml>
	

Save the customization and reimport into CRM

The button on the case form looks the same to the user but instead of the case resolution form the Case Resolution Dialog is launched.

Happy CRM'ing!