Step 1: Launch Form Editor for the Opportunity record, then click on Form Properties from the ribbon.
Step 2: Add a New Library by clicking Add in the Form Properties section.
Step 3: When a dialog box is presented, on the bottom left, select New to create a new web resource.
Step 4: Provide an appropriate Name and Display Name. From the Type selection, choose Script (Jscript), then click Text Editor.
Step 5: Paste in the following code.
Click OK. Save, Publish and Close the newly created Web Resource. CRM returns you to the Web Resource Look Up dialog window.
Step 6: Click Add to add the newly created Web Resource to the Form Library.
Note: if the new web resource is not already selected you may search for it again as shown here.
Step 7: Now scroll down to the Event Handler section on the Form Properties window. Ensure the Control is set to Form and Event is set to OnLoad, then click Add.
Step 8: On the Handler Properties window, paste in the Function Name, collapseOpporBusinessProcess, and click OK.
Step 9: On the Form Properties window, click OK, then on the Opportunity Form, click Save and Publish.
Now you are all set! You will now see that the Business Process Flow will be collapsed. You may see if for a brief period immediately following the above steps due to timeout settings in the code. This is required in order to allow the entire form to load (including sub-girds and other elements). The out-of-the-box expand/collapse functionality will still remain in place.
That’s all for today, folks. For additional tips and tricks, visit our blog weekly. You can also find more information regarding Business Process Flows in CRM 2015 here. And as always, if you need additional assistance with Dynamics CRM, don’t hesitate to reach out to us here at PowerObjects.