Automated Login to Web Application in USD 2016

Dynamics CRM Unified Service Desk 2016 can be used to configure the automated login to our standard web applications like gmail,hotmail etc.However through this post I am gonna explain how to do automated login to web application in USD on click of a button.

To achieve this , first we create a Hosted Control named Gmail with USD Component type as Standard Web Application and Hosting type as Internal WPF as shown below.

Gmail Hosted Control

Configure the hosted control with application as global and display it in MainPanel.

To launch the Gmail login we need to create an action call for the hosted control.For this, Go to Action Calls and create a new Action call for Gmail hosted control and select UI action as “Navigate”. As this action is provided by default which will allow the hosted control to navigate to particular URL specified in the data parameter as shown below.

action call for gmail

Now we need a button to invoke the action call and launch the Gmail login page. For this Go to Toolbars in USD and Choose Main Toolbar as we will display the Gmail button in it.

Click on new button and create a Gmail button with text and tooltip for the button. We can even specify the image to display it on USD. Choose a web resource name having email icon of any format as shown below.

Gmail Toolbar Button

Now specify the action call for button which will load the Gmail login page as we have created in the above mentioned steps. Till now we have configured to load the gmail page. To achieve our automated login we need to configure some more steps as among those are.

We will create an action call to automate our login on click of Gmail button. In this action call select the UI action as RunScript and hosted control as Gmail. In the data parameter we will now specify the credentials and automate our login as shown below.

In data parameter

var element = document.getElementById(“Email”);

if (element != null)
element.value = “<gmail id>”;

var nextButton = document.getElementById(“next”);

if (nextButton != null) {;


window.setTimeout(“setPassword();”, 2000);

function setPassword()
var element2 = document.getElementById(“Passwd”);

if (element2 != null) {
element2.value = “<pwd>”;

var signInButton = document.getElementById(“signIn”);

if (signInButton != null) {;


Run Script for Gmail

Call this action call in the PageLoadComplete Event of Gmail hosted control.


Now our basic set up is done lets launch USD and invoke the Gmail button as shown below

usd demo



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 )

Google photo

You are commenting using your Google 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