unable set mandatory a field in change request form by using g_form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:41 PM
unable set mandatory a field in change request form by using g_form
g_form.isMandatory('short_description',true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:43 PM - edited 07-06-2025 10:47 PM
Hi @sumanthpopu ,
you need to use g_form.setMandatory('short_description', true); not isMandatory()
Also pls review UI policies that is written on short_description field that may conflict
Mark correct if it is working for you
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:44 PM - edited 07-06-2025 10:45 PM
Hi,
Check if there is UI policy which makes the field Mandatory false or It can be that the field becoming readonly.
Client Scripts execute before UI Policies. If there's conflicting logic between the two, the UI Policy's logic will take precedence.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:47 PM
Hi,
Use the below code once
g_form.setMandatory('short_description',true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:58 PM
Hi @sumanthpopu
Use "g_form.setMandatory", g_form.isMandatory this will not work for setting field mandtory
"setMandatory" function sets the field as mandatory or non-mandatory whereas "isMandatory" function checks whether the field is mandatory or not returns Boolean value.
If my response solves your query, please marked helpful by selecting Accept as Solution and Helpful. Let me know if anything else is required.
Thanks,
Prerna