- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi All,
User should be restricted form access if he/she click on Decline, How can i do that?
Please suggest, TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Ankita9793 ,
You can handle this in your onLoad() function by adding an action to the Decline button:
function onLoad() { spModal.open({ title: getMessage('Information'), message: getMessage('Please make sure you have completed pre-requisites before raising engagement request with email team. SLA --> 15 business days after completion of cyber review approval. Do you want to proceed?'), buttons: [ { label: 'Decline', cancel: true, action: function() { // Option 1: Redirect to Service Portal home window.location.href = '/sp'; } }, { label: 'Proceed', primary: true, action: function() { // Allow user to continue } } ] }); }
For Decline, you can either:
Redirect to Service Portal home → window.location.href = '/sp';
Redirect to logout → window.location.href = '/logout.do';
Make the form read-only → g_form.setReadOnly(true);
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Ankita9793 ,
You can handle this in your onLoad() function by adding an action to the Decline button:
function onLoad() { spModal.open({ title: getMessage('Information'), message: getMessage('Please make sure you have completed pre-requisites before raising engagement request with email team. SLA --> 15 business days after completion of cyber review approval. Do you want to proceed?'), buttons: [ { label: 'Decline', cancel: true, action: function() { // Option 1: Redirect to Service Portal home window.location.href = '/sp'; } }, { label: 'Proceed', primary: true, action: function() { // Allow user to continue } } ] }); }
For Decline, you can either:
Redirect to Service Portal home → window.location.href = '/sp';
Redirect to logout → window.location.href = '/logout.do';
Make the form read-only → g_form.setReadOnly(true);
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
sorry didn't get your requirement?
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