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

Mohith Devatte
Tera Sage
Tera Sage

hello @absnow ,

you need to add gs.addInfoMessage('task has been completed') in the script

and in the condition also add like below 

 && current.state!=3

mark my answer correct if it helps you

 

Hi Mohith,

condition:current.template == 'f49234e5976c59504887b79fe153afe4' && current.assigned_to == gs.getUserID();

see the below code:

var parentRec = current.parent.getRefRecord();

current.state = 3;
current.update();
gs.addInfoMessage("Task has been closed complete");
parentRec.state = 18;
parentRec.update();

@absnow 

current.template == 'f49234e5976c59504887b79fe153afe4' && current.assigned_to == gs.getUserID() && current.state!=3;

change your condition to above so that it gets disappeared when it gets closed 

Afrith Shariff
Tera Guru

Hi, Absnow

you need to add gs.addInfoMessage('task has been completed') to show the message.

please click helpful if this is Helpful