Hi,
I know how to extend forms using javascript but so far it only looks like it works by adding the script to a landing page you create instead of directly to the marketing form itself in the HTML portion of the editor. Is this still not supported?
Hi Phil,
I regularly use some Js code to add functionality to the Dynamics 365 marketing module. For example, I use it to give dynamicity or to create conditions for visibility of certain fields.
As @Petr Jantač rightly pointed out, however, this definitely has limitations. To understand this, one must consider that the marketing module, and thus its code, is loaded in a specific order within the web page (creating a D365 marketing page or embedding the module in one's own web pages).
In any case, you can test your customizations in real-time with tools such as Visual Studio Code or other tools that allow you to have a graphical preview online.
Happy coding!
Regards,
Stephen
No, you can't. In Dynamics marketing forms are of 3 types, one of them being Landing Page. Technically, you can't have a marketing form without a page for it.
The javascript inside the HTML code of the form is supported. But there are some limitations, like certain events are triggered before the form markup is injected into a page, those won’t be available for the script added within a form.
Thank you.
Petr
That still sounds like you have to add the script to a page later and not to the form itself. I’m looking for a supported way to add the code directly to the form within the form designer HTML.
Hi pdr469,
Add JavaScript code on your Marketing form and test this custom code using marketing pages.
Add validations using JavaScript to Marketing form in Dynamics 365 | by Pooja Bhardwaj | Medium
I’m aware of the article but the article doesn’t specify if you can directly modify the form itself with JavaScript. Does anyone know if that’s supported?
Hi pdr469,
Please refer to the following documentation to know more about how to extended marketing form using JavaScript.
Extend marketing forms using code (Dynamics 365 Marketing Developer Guide) | Microsoft Docs
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156