Tuesday, 17 October 2017

Execute a Scriplet on a Action Call

Hi,

Now a days, I have started exploring USD and learning small things here and there. 

I got a requirement to Open a Web Page by considering some parameters from Account record in USD. To achieve this thing, we can directly pass parameters in the Data field of the Action Call but if there any conditions to check and frame the URL, we have to use Scriplet.

To create a scriplet, Navigate to CRM -> Settings -> Unified Service Desk -> Scriplets -> New

Give the name as per you wish

Write a code in the Script Text field. And don't forget to call the same method again as show in below.

function openGooglePage() {
    var vName = "[[account.name]]";
    var url = "http://www.google.com/search?q=" + vName;
    return url;
}


openGooglePage();

Now create an action call and give url=[[$scriptlet.OpenGooglePage]] in the Data column.


Hope this helps.

--
Happy CRM'ing
Gopinath