USD – Open an Entity from Search

Leave a comment

Let’s say you search for a record, and you want to display that record in a session. Here’s how to do it.

Firstly, the search is an entity itself that is a CRM page.

When you click on a Search record, a routing rule (Windows Navigation Rule) takes place. The routing rule is called Search Default and runs on the Search entity. There is no “to” entity so it is the default routing rule:

The action is to Create Session and the target tab is CRM Global Manager.

CRM Global Manager calls SessionDeactivated and SessionNew:

Under SessionNew, there are many events that occur:

The Agent scripting task will run but first check if the condition is met, in this case the entity is Account:

Once the CRM Global Manager events (i.e. SessionNew) and their actions (i.e. Load Agent Session Account Script) are complete, USD looks for windows navigation rules associated with the entity we are trying to open, in this case Account. We see there is a Default Account rule which opens the account entity:

The routing rule opens the Account entity with the Route Window action.

The Account record is displayed with these parameters:

USD then picks up the record id and the record type and displays the record:

Let’s go through an example of searching for a custom entity called Movies.

First, let’s create a hosted control for Movie. Make sure the type is CRM Page:

Now, we will need a windows navigation rule for Movie. Create a new rule and call it Default Movie. The entity is a lookup to the Entity Numeric Mapping Lookup View:

We will need to create our entity in this view. Click New and enter new_movie as the name. Make sure to name the entity by its name:

The navigation rule should look like below:

Then, in the CRM Global Manager, we know when a search is run it will start a new session. We can add a new action onto the SessionNew event to load an Agent Script if we want. Below is an agent script created and the load action. Note this is optional:

If you save and restart USD and search for a record, you will now see a Movie tab in a session with the record displayed:

In summary, to display a CRM record in a session:

  1. Create a hosted control for the CRM entity, and make the type CRM Page
  2. Create a Windows Navigation Rule that will open that entity (create entity type) from somewhere (or anywhere), and route window to tab
  3. Ensure a general routing rule exists for the search entity to any entity (or this new one) that creates a session
  4. In the CRM Global Manager, on Session New you can add actions to open or run agent scripts

 

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

 

Leave a Reply

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