Mandate Additional Comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:33 AM
Hi,
Iam trying to make Additional Comments mandatory when incident state is cancelled. For this i created UI Policy with condition State is Cancelled and UI action where additional comments are mandatory true.
But it is allowing incident form to save and then additional comments are becoming mandatory, how to make it mandatory before saving the form using this UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:45 AM
You can update the UI action script to check if the comment is blank, if it is blank them make it mandatory and throw error, only when comment is not blank you proceed with the rest of the code in the ui aciton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 03:49 AM
For a good and optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 04:06 AM - edited 02-23-2023 04:07 AM
An alternate approach is an onChange Client Script when the State changes:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == 8 ) { //Cancelled
g_form.setMandatory('comments', true);
} else {
g_form.setMandatory('comments', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 05:11 AM
Hi @Community Alums
You can write on change client script on state field as you want comments to be mandatory when state changes.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful