UI Macro in Client Script..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 05:32 AM - edited 06-05-2023 08:29 PM
Hi All,
How to get the value of an ui macro in client script?
We have an UI macro in a record producer, based upon the ui macro value I need to restrict form submission.
I tried using g_form.getValue('ui_macro'), it didn't give me value. Is there any other way to get the value for UI macro.
Kindly Suggest
Regards,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 05:42 AM
Hi @Sriraj V ,
Hope you are doing great.
Try using gel function to fetch UI macro id.
reference code:
function restrictFormSubmission() {
var uiMacroElement = gel('ui_macro_id');
var uiMacroValue = uiMacroElement.value;
if (uiMacroValue === 'restricted_value') {
// Perform actions to restrict form submission
alert('Form submission restricted based on UI macro value.');
return false; // Cancels form submission
}
return true; // Allow form submission
}
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 08:35 AM
Hi @Riya Verma ,
This is that oob ui macro - "std_chg_glide_list_change_requests"
which is used in the oob record producer - "Propose a new Standard Change Template"
My client script is,
This script is not working. Whether my macro id which i used in client script is wrong.? Kindly advise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:51 AM
Could you find a solution? Because I have a similar problem. Kindly suggest