Wednesday 30 December 2020

HOW TO APPEND MULTI SELECT OPTION SET IN DYNAMICS 365 USING MICROSOFT FLOW

Multi Select Option Sets were introduced in version 9.0 of Microsoft Dynamics 365 CRM. D365CE Multi Select Option Sets are a great new capability. The way to apply business rule functions to a Multi Select field is to use JavaScript.

Multiselect Option Sets are also limited in the case of Workflows. We can not select these fields in a condition nor modified in an update record step. The field will not even appear on the update record form. However, the field can still be selected as a trigger for the workflow.

If we want to append Multiselect option set values, we can use Microsoft flow.

NAVIGATION STEPS:

Step 1: Sign in to Power Automate.

Step 2: Choose the Environment where we need to create a flow.

MULTI SELECT OPTION SET_1

3rd Step: Select My flows from the navigation bar.

MULTI SELECT OPTION SET_2

Step 4: Click on New to create a flow.

MULTI SELECT OPTION SET_3

5th Step: Specify a Name for the flow and then choose the trigger point when flow need to be started.

MULTI SELECT OPTION SET_4

SCENARIO:

Let assume that, we are having two entities Contact (Parent) and Campaigns (Child) with 1: N relationship between them.

We have two fields called Policy Interest_Campaign and Regional Interest_Campaign. Field type is Multi select option set in Campaigns entity.

We have two fields called Policy Interest_Contact and Regional Interest_Contact.  Both are of type Multi select option set in Contact entity.

However in this scenario, if the Policy Interest_Campaign and Regional Interest_Campaign contain value then append it to Policy Interest_Contact and Regional Interest_Contact.

Step 6: Choose the Trigger condition from the options and choose the entity as Campaigns.

MULTI SELECT OPTION SET_5

7th Step: Get the records from the Campaigns.

Step 8: Get the records from the Contacts.

MULTI SELECT OPTION SET_6

9th Step: Initialize two variables for Campaigns.

MULTI SELECT OPTION SET_7

Step 10: Initialize two variables for Contacts.

MULTI SELECT OPTION SET_8

11th Step: Check condition for Policy Interests/Regional Interests is not equal to Null, which are in the Campaign record.

MULTI SELECT OPTION SET_9

Step 12: Fetch records of contacts associated with the selected Campaign.

Step 13: Check condition for Policy Interest is equal to Null, which is in the Contact record.

MULTI SELECT OPTION SET_10

14th Step: If yes, append the values from Policy_Interest_Campaign  to Policy_Interest_Contact.

In Append to String Variable Action. In the place of Name, choose the variable Policy_Interest_Contact and Value as which values. We need to append (Policy_Interest_Campaign field in Campaign entity).

Step 15: Update the Contact record. Choose the item ID value and the field (Policy Interests) which we need to update.

MULTI SELECT OPTION SET_11

MULTI SELECT OPTION SET_12

Step 16: If Policy_Interest_Contact contains values. In Append to String Variable, In the place of Name choose the variable Policy_Interest_Contact.

Multiselect option values appended using “,” (comma). In the Value as which values, we want to append (,) (Policy_Interest_Casmpaign field in Campaign entity).

Step 17: At the end update the Contact record. Choose the item ID value and the field (Policy Interests) which we need to update.

MULTI SELECT OPTION SET_13

MULTI SELECT OPTION SET_14

18th Step: Repeat Step 13 to Step 17 for Regional Interest.

MULTI SELECT OPTION SET_15

Resource: https://www.adyatantech.com/blogs/how-to-append-multi-select-option-set-in-dynamics-365-using-microsoft-flow

Thursday 17 December 2020

HOW TO SORT LOOKUP FIELD IN A CUSTOM ORDER IN DYNAMICS 365?

In this blog we will learn how to sort a lookup field in a custom order in Dynamics 365.

Sorting makes it easy for us to get a quick overview of the data. For example, if we have many customers, we could sort them by Customer No., Currency Code, or Country Region Code to get the overview we need.

Consider a scenario, on a Work Order we have Incident Type and the values in the lookup sort based on the primary field. If we must sort the Incident Type records based on the priority.

 Incident Type records

We have to create a field for priority which can be either Single Line of Text or Whole Number.

Navigate to Advanced Settings -> Customize the System

Expand the required entity and select Fields and create a new field.

Then add the field on to the form to provide the Priority.

For lookup values, there is by default a view is created “<Entity Name> Lookup View”, here in our scenario Incident Type Lookup View.

Open the Incident Type Lookup View and from Add Columns, select the Priority field which is created.

Add Columns

Sort the view on Priority either in Ascending or Descending order based on the requirement.

Click -> Configure Sorting -> provide Sort By and Select either Ascending or Descending

Configure Sort Order

Now open the form where we want to sort the Lookup value.

In the Field Properties, Under Display tab turn off recently used items.

Disable Most Recently

Configure the Default View as the view we have configured, Incident Type Lookup view.

Incident Type Lookup View

Save and Publish the Customizations.

Now in the form we can see the Sorting order of the Incident Type Lookup view based on the Priority.

Look for Incident Type

Other way round to achieve this is adding a prefix to the records, e.g.,

  • 1 – Test & Inspect
  • 2 – Support – Phone
  • 3 – Internal

Open HTML Page from Button with Ribbon Workbench

There may be a requirement to open an HTML page from a button. In this example, we will use the Ribbon Workbench to open a page from a butto...