Hi,
Is there a way to set all fields on a specific tab required based on an option set value using jscript?
Thank you
*This post is locked for comments
Hi Samuel Kimathi,
Please try the JS code below.
function SetBusinessRequired() { var optionSetValue = Xrm.Page.getAttribute("optionSetName").getValue(); if (optionSetValue == 10000000) { //Check if the option set value is your value Xrm.Page.ui.tabs.get("tabName").sections.forEach(function (section, sectionIndex) { section.controls.forEach(function (control, index) { control.getAttribute().setRequiredLevel("required"); }); }); } }
Hope this helps.
Hi Samuel,
This article can help you:
crmandcoffee.wordpress.com/.../set-as-business-required-all-fields-on-a-tab
You can do this using business rules or JS.
With business rules you will need to specify the fields that have to be required.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156