Want to set info message once click on button

abirakundu23
Mega Sage

Hi All/  @Mohith Devatte  ,

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.

 

6 REPLIES 6

SumanthDosapati
Mega Sage
Mega Sage

Hi @absnow 

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

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader