- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi team,
We have an OOB UI Action. We need to convert the UI Action so that when someone clicks on the button, it should show a pop up message saying 'Are you sure you want to cancel' with yes or no. if yes is selected, it should perform the activity else it should not do. Kindly help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Client checkbox- checked
onclick - cancelRecord()
something like this in script
function cancelRecord() {
var confirmValue = confirm('Are you sure you want to cancel');
if (confirmValue)
gsftSubmit(null, g_form.getFormElement(), 'cancel');
}
if (typeof window == 'undefined')
serverCode();
function serverCode() {
current.status = 'canceled';
if (new global.ProcurementUtiLs().hasHardwareAssetsForPO(current)) {
current.asset_operation = ProcurementUtils.ASSET_OPERATIONS.DELETE;
current.update();
action.setRedirectURL(current);
}
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
make the UI action as client side and update the script to use gsftSubmit()
it's an easy requirement
what did you start and where are you stuck?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Client checkbox- checked
onclick - cancelRecord()
something like this in script
function cancelRecord() {
var confirmValue = confirm('Are you sure you want to cancel');
if (confirmValue)
gsftSubmit(null, g_form.getFormElement(), 'cancel');
}
if (typeof window == 'undefined')
serverCode();
function serverCode() {
current.status = 'canceled';
if (new global.ProcurementUtiLs().hasHardwareAssetsForPO(current)) {
current.asset_operation = ProcurementUtils.ASSET_OPERATIONS.DELETE;
current.update();
action.setRedirectURL(current);
}
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
