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.)https://msdn.microsoft.com/en-us/library/dn864915.aspx
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:
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