USD – Select Forms

I have often wanted to control which form the operators use in Unified Service Desk (USD).

For example, you might create a form which has been tailored to support the logging of cases on the phone. And therefore you want to “force” all USD operators to have this form when they are following a particular agent script.

I created the code below this morning, which It think will do the job. At the moment I have only implemented this by calling the code directly in the debugger. When I get a spare minute I will implement this concept from an agent script and document more fully.

Use the RunXrmCommand action to trigger the code.

My code was …..

var formType = Xrm.Page.ui.getFormType();
var currentForm = Xrm.Page.ui.formSelector.getCurrentItem().getId();
var newForm = "USD Main";
var forms = Xrm.Page.ui.formSelector.items.get();
var i = 0;
for(i=0; i<forms.length; i++) {
            if (forms[i].getLabel().toLowerCase() == newForm.toLowerCase()) {
                if (currentForm != forms[i].getId()) {

I ran this in the debugger it looked like this …


Then the account form I had loaded changed to “USD Main”, shown below;


One thought on “USD – Select Forms

  1. Pingback: USD – The Book | Microsoft Dynamics CRM and Unified Service Desk

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s