
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2020 02:50 AM
I am new to Service Now. I have been assigned a task in which in the first step I need to create a UI action on an incident table and I have done it. The second step includes setting the additional comments mandatory on clicking the UI action and deliver a field message reading: "Please add additional information".
Kindly help me completing my SNOW task.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2020 05:31 PM
Salam Abdul,
Your Question title and question description is contradicting. UI action and UI policy are two different things. So, I am going by question description and this is your code to make additional comments field mandatory and showing the field msg using UI action
Make sure client checkbox is "checked", action name is "mandatory_comments" & onClick is "reopen()"
//Client-side 'onclick' function
function reopen(){
if(g_form.getValue('comments') == ''){
//Remove any existing field message, set comments mandatory, and show a new field message
g_form.setMandatory('comments', true);
g_form.showFieldMsg('comments','Please add additional Information.','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'mandatory_comments'); //MUST call the 'Action name' set in this UI Action
}
Please mark this correct & helpful if it answered your question.
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2021 09:47 PM
Hi,
If you are somehow storing the INC record on the parent field of REQ once REQ and RITM are created then you can use after insert BR on REQ and update the INC with that state
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2021 11:51 PM
Hi Ankur,
Do we have a sample of how that code would look like in BR?
Also, should we just remove the state update that is happening in the UI Action?
Regards,
Surabhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2021 12:34 AM
Hi Ankur,
I managed to achieve this by using the glide function.
Thanks for the help.
Regards,
Surabhi