how to make a field mandatory after it goes for approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 08:49 PM
I have a request where when a manager approves a change request, a mandatory field must be filled out by the manager. I have no idea on how to do that. I can set the field to mandatory at any other stage but how can I make it so that once the manager approves the request, they must enter a value in the field. Many Thanks in advance for your feedback.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 08:54 PM
mandatory field on Change request?
If yes then why would approvers enter data in CHG form?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 09:29 PM
Hi @Matt J Thomas ,
One way of doing it would be to modify the approval widget in the portal in a manner wherein once the approver presses the approver button a pop up can come similar to when reject button is pressed for entering the comments on the portal.(This recommendation is specific to portal).
But this would require cloning & customising the approval widget as per your need & condition specific.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 11:03 PM
Is the field on the Change Request table? If that is the case, you can create an OnSubmit Client Script to do the validation and display a message to tell the approver go to the Change Request to fill in the information.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 07:02 AM
Can you please be more specific to this regard? Yes the field is on the Change Request Table. I believe your solution may work.
Here's a sample of what I am thinking based on your feedback:
function onSubmit() {
//Type appropriate comment here, and begin script below
var w = g_form.getValue( 'u_scheduled_for_release' );
var approval = g_form.getValue('approval');
if ('approval' == "Approved" || 'w' =="")
alert ('Please enter a value in the Scheduled for Release field');
}
Thank you