- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 04:27 AM
Hi Team,
I have a client script like below to ensure one field is mandatory while closing the task it is working fine but my issues is even if i need to update or save the task then also it is not allowing me to do. In short my requirement is to run the script only when the "close task" button got clicket not the "save" or "update" button/UI action.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 04:57 AM
You can check whether which UI action got clicked or not in onSubmit client script as below
give the action name
function onSubmit(){
if(g_form.getActionName() == 'close_sc_task'){
// your code here
}
}
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
‎11-24-2020 04:57 AM
You can check whether which UI action got clicked or not in onSubmit client script as below
give the action name
function onSubmit(){
if(g_form.getActionName() == 'close_sc_task'){
// your code here
}
}
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
‎11-24-2020 05:33 AM
Thanks Guys i put the condition initially and it worked smoothly 🙂