- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 10:38 PM
current.state = -5;
current.type = "emergency";
g_form.setMandatory('category', true);
g_form.setMandatory('cmdb_ci', true);
g_form.setMandatory('priority', true);
g_form.setMandatory('risk', true);
g_form.setMandatory('impact', true);
g_form.setMandatory('short_description', true);
var arr = g_form.getMissingFields();
alert("The ID s of fields that are mandatory are not filled : " + arr);
current.update();
Couldn't get my code to work. I'm trying to set form fields as mandatory in Emergency changes when the state is new.
What is missing from my code?
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 10:44 PM
Hello,
Please follow below link, Mark my answer as correct if that helps.
https://community.servicenow.com/community?id=community_question&sys_id=a323c3581b3dc110faf255fa234bcb78
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 10:41 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 10:44 PM
Hello,
Please follow below link, Mark my answer as correct if that helps.
https://community.servicenow.com/community?id=community_question&sys_id=a323c3581b3dc110faf255fa234bcb78
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 11:11 PM
Thanks!