Wednesday 13 January 2021

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 button.

First, create a new solution and go to Web Resources:

HTML1

To create new Web Resource below are steps:

  • Click New

  • Enter Web Resource Name

  • Select Type as Webpage and then select Text Editor:

HTML2

This will open an HTML page:

HTML3

Selecting the Source tab will show the HTML:

HTML4

Enter some text and press OK:

HTML5

Click Save and Publish:

HTML6

Now, We need some JavaScript to open the new page. Create a new Web Resource, this time select webresource type is equal to JScript:

HTML7

Go to the text editor and enter a function that will open the page:

Xrm.Utility.openWebResource(“Give HTML Page Name we created”);

HTML8

function OpenPage () {

Xrm.Utility.openWebResource(“adyt_TestHTMLPage.html”);

}

Save and Publish the Web Resource.

Now we will add an entity to our solution that will have the button we are launching this from. Add the Customer entity:

HTML9

Save and publish the solution. We can now use XRM Toolbox for Ribbon Workbench Solution.

If in Your XRM Toolbox Ribbon Workbench solution is not installed, Please Install that solution first.

HTML10

The workbench will open:

HTML11

Select Solution that we want to open and click on OK Button.

After that Solution is Downloaded.

Drag a button from the Toolbox to the Form area:

HTML12

Rename the button:

HTML13

Click + to add a command:

HTML14

Under Actions, select Add Action and JavaScript:

HTML15

Type the name to look up the resource:

HTML16

Add the Function Name:

HTML17

Then Add CRM Parameter –> Click on CRM Parameter

HTML18

Select Primary Control

HTML19

Set the Command for recently created Button.

HTML20

Click Publish.

Pop Up will appear.

HTML21

Open the Customer Form. The new button will appear in the Ribbon.

HTML22

Click on OPEN HTML PAGE Button. JavaScript is executed and the web page is Displayed:

HTML23

Resource: https://www.adyatantech.com/blogs/open-html-page-from-button-with-ribbon-workbench

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

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