- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2018 09:45 AM
How can I enforce mandatory field check in a client-side UI action?
I've tried putting 'g_form.checkMandatory = true;'
inside my function that is called on click and I want a check just like 'Save' UI Action, it should not allow further action if mandatory fields are not filled.
Thanks in advance!
Rishi
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 07:05 AM
There is one way to do this using below client side ui action :
if(g_form.mandatoryCheck() == true)
{
return false;
}
else return true;
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 02:49 AM
This will only work for fields that are mandatory by the dictionary and not by UI Policies or Data Policies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2018 11:35 PM
UI Action:
onclick: mandatory();
Script:
function mandatory()
{
var mandatory = g_form.getMissingFields();
if(mandatory == "")
{
return true;
}
else
{
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 02:50 AM
I've already mentioned this to you in the previous response.
Thanks for your efforts though!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2018 11:03 AM
Hi,
g_form.setMandatory('fieldname',true); // To make mandatory
g_form.setMandatoy('fieldname',false); //to make non-mandatory
g_form.setReadOnly('fieldname',true); // To make Readonly
g_form.setReadOnly('fieldname',false); //to make non-readonly
Please mark this as "Correct Answer" if I have given you a sufficient answer to your question.
Best Regards,
Daniele

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 12:14 AM
Hello Rishi
UI Action:
onclick: mandatory();
Script:
function mandatory()
{
var mandatory = g_form.getMissingFields();
if(mandatory == "")
{
return true;
}
else
{
return false;
}
}
Thanks
Abhijeet Upadhyay