Notifications
Announcements
No record found.
Hi Everyone,
We have an option set field called Lead Source on our Lead entity and we'd like to populate it from a Marketing Form. We don't want Lead Source visible on the form.
It doesn't seem like you can hide an option set field. Does anyone have any advice on how to solve this problem?
Thanks,
Tony
Hi Anthony,
We can hide an option set field manually by adding hidden attribute control to its content block.(I formatted form source code in VS editor for better look.)
hidden="hidden"
Result:
Regards,
Clofly
Clofly's answer below works fine. However, if you want more extensive lead source tracking you might also want to look at using UTM for source. (wrote a little manual on that: community.dynamics.com/.../how-to-guide-on-implementing-utm-tagging-in-dynamics-365-marketing)
You have a complete view of your source this way and the effectiveness:
source: Linkedin
medium: social
Campaign: name of your specific campaign/post
Thanks so much for the quick reply Clofly! You always provide such expert answers!
If we wanted to set the value of the option set in the background (ex. depending on the a variable like page title), how would we do it? The visible fields are available for user input, but how do we populate the value of hidden fields like this?
Thanks again,
Hi Niels, Thanks for your reply. I tried to click on the link you provided, but it's not working. Can you reshare?
Hey Anthony, it seems really hard to add an attachment to posts in the forum here. Which is why I added is a dropbox link. Nonetheless, I edited the post and added another link that should work. I also sent a private message with the file. Hope this helps. Feel free to ask questions.
We could set a default selected option manually by javascript.
https://stackoverflow.com/questions/78932/how-do-i-programmatically-set-the-value-of-a-select-box-element-using-javascript
In posted link, the demo select element(optionset) has a pre-defined id,
however, we couldn't add id attrribute to elements of Marketing Form,
an alternative solution is that by getting optionset element(select element) object directly with getElementsByTagName() Method:
var selectElement = document.getElementsByTagName("select")[0];
(expression above is equal to "document.getElementById("preference")", if there is only one select element on HTML page and its id attribute is "preference".)
Then we can get value attribute of a specific option by inspector.
Finally run our populating function at "afterFormLoad" event of form.
https://docs.microsoft.com/en-us/dynamics365/marketing/developer/marketing-form-client-side-extensibility
Please feel free to ask any question if you had any doubt about it. :)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 83 Super User 2025 Season 2
Gerardo RenterÃa Ga... 49 Most Valuable Professional
#ManoVerse 40