Perform different actions if User select OK/CANCEL in Confirm UI Action?

Jayant_M
Kilo Sage

Hi All,

Question:- If user click on Confirm Button(UI Action) and if he selects OK then incident state should should change to On-Hold and update the record and if user selects CANCEL , then Confirm Button(UI Action) should be hidden. How should I write the code in UI Action? (Confirm button is customized UI action) 

 

Thanks in advance.....!!

1 ACCEPTED SOLUTION

Prince Arora
Tera Sage
Tera Sage

@Jayant_M 

 

I hope you have written a client side UI action, just mention the code as below:

 

To hide the confirm, button you can create a flag variable on the form and set it as false by default, once it goes to else state in below code, make it true and display the UI action only if your flag variable is false

 

var toggle = confirm("Do You want to continue?")

if(toggle){

g_form.setValue("state","Backend_value_of_onHold_state"); // check bakcend value

}else{

g_form.setValue("flag","true")

}
g_form.save();

 

I hope you will get some idea how to do

 

If my answer solved your issue, please mark my answer as āœ…Correct & šŸ‘Helpful based on the Impact.

View solution in original post

1 REPLY 1

Prince Arora
Tera Sage
Tera Sage

@Jayant_M 

 

I hope you have written a client side UI action, just mention the code as below:

 

To hide the confirm, button you can create a flag variable on the form and set it as false by default, once it goes to else state in below code, make it true and display the UI action only if your flag variable is false

 

var toggle = confirm("Do You want to continue?")

if(toggle){

g_form.setValue("state","Backend_value_of_onHold_state"); // check bakcend value

}else{

g_form.setValue("flag","true")

}
g_form.save();

 

I hope you will get some idea how to do

 

If my answer solved your issue, please mark my answer as āœ…Correct & šŸ‘Helpful based on the Impact.