Dynamics CRM Integration with Azure Service Bus–Part 1

Technology Notes

Last month, one of my friend called me and asked me if I can help him integrating Dynamics CRM with an on-premises line of business (LOB) application using Azure Service Bus. He was a SharePoint expert, with reasonable experience of Dynamics CRM and Azure Service Bus also and he had to develop a POC for his client to win a project. By then I didn’t have any experience with Microsoft Azure. So, I looked it as an opportunity for me to learn something new, the Microsoft Azure Service Bus. I spent few days studying and watching concepts and demos regarding Microsoft Azure, Azure Service Bus and Dynamics CRM-Azure integration. Eventually, we both started working on the project. The project had few other challenges too, but mainly I learned enough about Azure Service Bus and Dynamics CRM integration while working on this project. In this two part series of blog post…

View original post 1,114 more words

[Exploration] Dynamics CRM Azure-aware plug-in + Azure Queue + Power Automate

Temmy Wahyu Raharjo

Do you know the Azure-aware plugin? In short, we can create a simple plugin that invokes Azure Service Bus that enables us to do the Publisher-Subscriber model. In this blog post, we will try to makeAzure Service Bus, Dynamics CRM Service Endpoint, andCRM Pluginfor creating the queue. While for the processing part (subscriber), we will createCloud Flowthat will listen to the queue + insert a row on the google sheet.

Creating Azure Service Bus

You can go to your portal.azure.com >Service Bus> click theCreatebutton. On that page, you can fill in theSubscription, create/select theResource group, fill theNamespace, set theLocation, and set thePricing tier(I choose Basic for the demonstration purpose which is the cheapest tier). After that, you can hit theReview+createbutton and proceed to create the resource.


View original post 855 more words

Two way communication between CRM and Azure Service bus

Srikanth Alluri

This is the next level of my previous post on Azure service bus integration with CRM. If you haven’t gone through it already, I would highly recommend you to go through it first over here as whatever we are going to do here in this post is kind of an extension to my previous one.

So, in the last post, we saw how we can pass the CRM entity information to ASB (Azure Service Bus) whenever it got created/updated/any other plugin actions happened. And you must have noticed by now that it would be an asynchronous job for us, meaning CRM would be in ‘fire and forget’ mode. All it knows is it has dropped a ‘Message’ in a Queue, it doesn’t know when it got picked up and when it got processed and who picked it up etc. In some cases this might be the exact behavior we are…

View original post 1,462 more words

How to – use Dynamics 365 Marketing JavaScript API to set hidden field’s value

Dynamics Marketing JavaScript API is only available for the marketing form hosted as Script. It is not available for forms hosted as Iframe.

More on embedding form on external page – https://nishantrana.me/2022/11/10/how-to-embed-marketing-form-on-an-external-page/

Add a reference to form-loader.js or load.js to access the API.

Below is our form with a hidden field in it.

Based on the current living situation (drop down), we want to set the value of the Financially Capable field (bool) – the hidden field’s value as either True or False.

For this, we have added the below script, in the formSubmit event.

formSubmit triggers on form submit before the form submission is sent to the server.

Check all the events here – https://learn.microsoft.com/en-us/dynamics365/marketing/developer/marketing-form-client-side-extensibility#form-events

The script – Get the id of the element through browser’s developer tools.

Hope it helps..

  // Extending Marketing form with code 
        // formSubmit - Triggers on form submit before the form submission is sent to the server.
        MsCrmMkt.MsCrmFormLoader.on('formSubmit', function (event) {
            // get the id of the elements through developer tools of the browser
            // based on selected current living situation (optionset)
            if (document.getElementById('deb110aa-e266-ed11-9561-000d3ae090c0') != null) {
                var selectedCurrentLivingValue = document.getElementById('deb110aa-e266-ed11-9561-000d3ae090c0').value;
                if (selectedCurrentLivingValue == 881990000) {
                    // set the value of Financially Capable field (boolean)- true / false
                    document.getElementById('dcc46e64-2867-ed11-9561-000d3ae090c0').value = "1";
                else {
                    document.getElementById('dcc46e64-2867-ed11-9561-000d3ae090c0').value = "0";

Fixed – Hide field option missing for dropdown (OptionSet) field in Marketing Form – Dynamics 365 Marketing

Recently while designing the marketing form, we realized the Hide field option missing for our dropdown fields.

There are 2 ways to solve this –

In the HTML designer mode for the Marketing form –

  • Add the attribute hidden=”hidden” for the field

The field will be hidden but the Hide field toggle won’t be available in the designer.

  • Change the data-editorblocktype from “Field-dropdown” to “Field-checkbox“.

This adds the Hide field toggle option in the designer.

The result –

The helpful thread – https://community.dynamics.com/365/marketing/f/dynamics-365-for-marketing-forum/391470/how-do-i-populate-lead-source-from-a-hidden-field-on-marketing-form

Hope it helps..


How to – use Page Personalization in Dynamics 365 Marketing

Page personalization uses cookies stored in the user’s browser for identifying the contact, and then fetches values for the contact record using JavaScript.

For page personalization to work –

  • The domain should be authenticated
  • It must use HTTPS
  • Contact should have Prefilling enabled i.e. Prefill Marketing Form field in the Contact record should have the value Allow.
  • Specify the contact fields to be made available.

Below is the marketing form (landing page) that we’d be using.

The form has a Remember Me element in it required for Personalized Pages. It gets automatically added to the form if we enable PreFill for the form.


We have only kept Pre Fill enabled for the City field. The other fields in the form have prefilled disabled.

Create a new personalized page, navigate to Outbound marketing >> Marketing Content >> Personalized Pages and add

Personalized page fields to it

After adding the fields, Click on Go live.

Going live generates the JavaScript
code, that we’d paste into our page, in the <head> section of the HTML.

As we have added 3 Personalized page fields, we will have access to the value of only these 3 fields on the page where this script is used, even though our Marketing form can have multiple fields or even if the cookie has other values stored as part of another marketing form.

Below we have added the JavaScript code in the head section and modified it to fetch the value of 3 fields added and also we have the code for embedding the Marketing form.

Lastly, we have a Div element to show the personalized message to the user.

Below is our page

Let us populate the values and submit the details (with Remember me enabled)

Let us refresh the page after a few seconds. This is because in the background we will have the lead/contact record either created or updated based on what we have specified in the Marketing form.

As expected, we have the div populated with First Name, Last Name, and City details using the Personalized Page’s JavaScript.

Also as we had Pre-fill enabled for only the City field, we can see the value automatically populated for it.

Please referhttps://meganvwalker.com/d365-marketing-personalised-pages-on-your-website/

Get more detailshttps://learn.microsoft.com/en-us/dynamics365/marketing/personalized-page-content


Hope it helps..


%d bloggers like this: