USD – Agent Scripting Extra Actions!

Whilst researching actions / events in Unified Service Desk (USD) for Microsoft Dynamics CRM I stumbled across a couple connected with agent scripts I hadn’t seen before.

On the Microsoft site you will find a description of the agent scripting hosted control and its actions / events. But two actions aren’t mentioned! (Hopefully they will be added soon.)

Until they are added, the details are as follows;

Action – ClearHistory

Clears the agent script history by clearing the values in the drop-down list on the Agent Scripting hosted control. In a single call an agent can load multiple scripts, below I show a screen shot of the history showing three scripts which have bee loaded.

It might be that you want to clear this list. Maybe this could happen if the customer has multiple requests in one call. Or maybe having completed an initial verification script you want to clear that from the history.

Below you can see I have given an example by running the ClearHistory action in the debugger. Notice that under the CALL SCRIPT heading the history drop down is now blank.

The ClearHistory action clears the script history it doesn’t stop the current running script.

In a real example I might follow the ClearHistory action with a GotoTask action to load a new script. (To replace those I’ve cleared.)

Action – RegisterVisitedAnswerList

Registers an event to be invoked when a specific task is reached.

name The name of the registration.
step The agent script task name that you want to register an event for.
The remaining parameters should consist of

<answername>=<bool value> pairs.

If <answername>=true, it will fire the event if the answer has been visited. If <answername>=false, it will fire only if the answer hasn’t been visited.   If an answername isn’t included here but is included in the list of answers on the task, the event is fired regardless of whether it has been visited or not.

When the conditions are met, the RegisteredVisitedMatch event will be fired, with the following parameters:

task=<task name>
taskid=<task guid>
name=<registration name from above>

Below you can see an example of how I have run this action in the debugger. Before I ran this action I also created an event on my agent scripting hosted control called “RegisteredVistsedMatch”.

Once this action has been run, the RegisteredVisitedMatch event will trigger once the created case AND Send Email answers have been selected. As I have shown below.

This action is designed for advanced situations when you wish to trigger an event when certain combinations of answers are true (or false). Maybe, for example, you want the event to be triggered if an operator has created a case and an opportunity from a script. Or if an agent has created a case but hasn’t sent an email etc.

Hopefully you will find ClearHistory and RegisterVisitedAnswerList useful. J

5 thoughts on “USD – Agent Scripting Extra Actions!

  1. Hello Neil,

    I congratulate you on your web, I am serving me much help within dond project we are implementing USD.

    I wanted to ask you a question about the action “clear history” script agen, I’ve tried and I clean perfectly the dropdown agent script, but questions me still leaves marked with the chek, is there any way by any action clean the questions that are within agent script ??

    Greetings and thanks for everything.


    • I found it cleared the history and the questions. But didn’t clear the current script that was active. I think if / when I use this action I would clear the script with it and immediately follow it with another action. A GotoTask to load the script I want to now have active.

      Thanks for your comments on my blog. I do my best! I use my blog as a way to learn new things so it benefits me and if a few other people benefit then that is a bonus.🙂


      • Hi Neil

        How are you?

        thank you very much for answering this issue, but I think I have a problem with “ClearHistory action” the action does not remove the agent checks of the “answer script”.

        I think the problem has to be in some settings of USD, yesterday I implemented your method “USD – Agent Scripts – Customer Verification” and makes all right except update the values of the parameters on agent script answer.

        Do you have any idea??

        Neil A greeting and thank you very much for the great blog you are creating🙂


      • Unfortunately the results you have had were my experience it does clear the history. Meaning if you have navigated to multiple agent scripts it would clear the list you have viewed. But it didn’t clear the details currently displayed. I felt I might use this action but only when I was going to follow it with a gototask action that would replace the currently viewed script. I must admit that when I first saw the results they weren’t quite as I’d imagined.

        Thanks for your comments about my blog.


  2. 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 )

Google+ photo

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

Connecting to %s