Using USD Event Parameters To Help With Business Logic

2 Comments

In this post, we will look at Unified Service Desk Event Parameters that can be used to help with building business logic into your USD apps. Event Parameters are parameters that are populated as a result of a USD event occurring. When used with action calls when events run, they can be used like other parameters in USD. Let’s look at how they work.

In my USD environment I have 2 tabs, Dashboard (Global) and Bing Map:

When a user clicks from one tab to another, we can see from the USD debugger that it is running the ApplicationTabChange event, and we can see the Parameters on the right – currentApplication and previousApplication:

Let’s go to the USD configuration and add some events to show we can use these parameters. For the CRM Global Manager, go to Events:

In my case, the ApplicationTabChange event is not here, so let’s add it (we know it runs, we just need to add it so we can use it if we want):

Add an existing Action Call:

Let’s add a DisplayMessage action with the data to display:

Current application: [[currentApplication]] Previous application: [[previousApplication]]

Add it to the ApplicationTabChange event and start USD.

In clicking from one tab to another, we see the action call is invoked, and the event parameters are being displayed:

So this is useful if we wanted to know where a user is clicking from and to. Let’s try it with another event. We see when we click on a Contact record in USD, it runs the NavigationRequested event, and it has the URL of the record:

Let’s go to the Contact hosted control and see this event:

We will add a new action call to display the [[url]]:

Now, in USD when clicking on a Contact we see the URL is displayed:

This can be useful if we wanted to parse the URL to see which record is being selected, and potentially add more logic such as getting the record with an entity search.

Check out the USD documentation online which shows parameters under the pre-defined events per hosted control:

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

2 Responses to Using USD Event Parameters To Help With Business Logic

    • Hi Gamal, in your action call, you can add a condition for whether it is enabled to run or not. The syntax would be “[[currentApplication]]” == “account”.

Leave a Reply

Your email address will not be published. Required fields are marked *