How to – Hide, Submit and perform validation in Dynamics 365 Marketing Form


Continuing our previous post on setting hidden field’s value using JavaScript in Embedded Marketing Form,

https://nishantrana.me/2022/11/23/how-to-use-dynamics-365-marketing-javascript-api-to-set-hidden-fields-value/

below are a few more points that could help –

  • To hide the Marketing form on the host page – we can use afterFormRender
  • To submit the Marketing form on the host page –

  • If we are setting a non-existing value for an option set field in the formSubmit event, it will be treated as blank before submission and the blank value will be passed. However if the field is Required then validation will kick in and the form will not get submitted.

Get more details – Extend marketing form using code

Also check – https://community.dynamics.com/365/marketing/f/dynamics-365-for-marketing-forum/384055/integrate-external-marketing-form

 

var xhttp = new XMLHttpRequest(); 

xhttp.open("POST", formUrl + "/formpage/” + formId + “/correlation/” + correlationId, true); 

xhttp.setRequestHeader("Content-Type", " application/x-www-form-urlencoded"); 

xhttp.send("7d58e055-d1c2-4bb3-a42f-faf6762e0acc=FirstName&3cdeebb-7c54-4cff-a1bc-772562d25c38=firstname.lastname%40sample.com&submit=");
Advertisements

Hope it helps..

Dynamics CRM Integration with Azure Service Bus–Part 1


Khadim Ali's avatarTechnology 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


temmyraharjo's avatarTemmy 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.

Create…

View original post 855 more words

Two way communication between CRM and Azure Service bus


ansrikanth's avatarSrikanth 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";
                }
            }
        });
Advertisements

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

Advertisements

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓