Want to set info message once click on button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 12:03 AM
Hi All/
We have created ui action "conferm and Complete" on "sn_hr_core_task", once click on button task should be closed complete and shows message your task is completed and button will be disable.task is closed complete but not showing message and not disable the button.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 12:30 AM
Hi
Change condition to below
current.template == 'f49234e5976c59504887b79fe153afe4' && current.assigned_to == gs.getUserID() && current.state!='3';
//check backend value of closed complete in above condition
Script :
var parentRec = current.parent.getRefRecord();
current.state = 3;
current.update();
parentRec.state = 18;
parentRec.update();
gs.addInfoMessage("Task has been closed complete");
Mark as correct and helpful if it solved your query.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 12:35 AM
Hi,
Please discuss with your customer on what should be the condition in which the button should be shown
On which states it should be shown and accordingly update the condition to compare against state value
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader