- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 07:52 AM
Hi Everyone,
I have a requirement for to show the message when approver click on approve button
1. approval send to group manager after group manager approved another approval send to business owner
i done this
now i want show the message “have you transferred all active tickets, tasks, and applications?” Yes approved when both approvers click on approve button
how can i achieve this
I am trying through Display BR sysapproval_approver table but how can i get the cat item
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 02:48 AM
Hi Ankur,
The below code will effect on all catalog items
Display BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 07:55 AM
you can query and get the catalog item name
Use Before Update BR and condition as State [Changes to] Approved
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ritmSysId = current.sysapproval;
var gr = new GlideRecord("sc_req_item");
gr.addQuery("cat_item.name", "Your Catalog Item Name Here");
gr.query();
if (gr.next()) {
gs.addInfoMessage('have you transferred all active tickets, tasks, and applications?');
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 07:58 AM
you can use onload client script on sysapproval_approver table + Display BR
Something like this in Display BR
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var ritmSysId = current.sysapproval;
var gr = new GlideRecord("sc_req_item");
gr.addQuery("cat_item.name", "Your Catalog Item Name Here");
gr.query();
g_scratchpad.showMessage = gr.hasNext().toString();
})(current, previous);
onLoad client script on sysapproval_approver
function onLoad() {
if (g_scratchpad.showMessage == 'true')
g_form.addInfoMessage('have you transferred all active tickets, tasks, and applications?');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 06:55 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 11:58 PM
Hi Ankur,
Thanks for response
Message is showing when state is requested .
but my requirement is when approver click on approve button message should appear state should not be change