UI Action

hadron_collider
Tera Contributor

Hello,

 

 

I am trying to configure UI action so that when "reject" button is clicked the status (u_reject_reason field) changes from "Requested" to "Rejected" however I am not able to save this change. 

 

kata90_0-1704289844043.png

 

when i go back to see the record details it s back to "requested" state:

kata90_1-1704290265289.png

 

here is the script:

 

kata90_2-1704290379062.png

 

1 ACCEPTED SOLUTION

Hello @hadron_collider , 

 

Please refer to my previous screenshot for this.

 

If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.

 

Thank You!

Prathamesh.

View solution in original post

9 REPLIES 9

Prathamesh G
Kilo Sage
Kilo Sage

Hello @hadron_collider ,

 

UI action is a Server Side scripting method. So rather than using 'g_form', You can use 'Current'. Please follow the below script to set the values as per your requirement.

 

current.u_reject_reason = "rejected";
current.update();
gs.addInfoMessage('This record has been Rejected');

 

If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.

 

Thank You!

Prathamesh.

Hi!

Thank for checking but I tried this as well and it does not work at all. In fact when I click on the button even the status does not change 

Hello @hadron_collider ,

 

You can refer to the below screenshot for your UI Action configuration.

 

Prathamesh_0-1704291634670.png

 

If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.

 

Thank You!

Prathamesh.

Ankur Bawiskar
Tera Patron
Tera Patron

@hadron_collider 

The above script should work with 2 below configurations

1) Client checkbox checked

2) Onclick field should have reject()

please share the UI action configuration screenshot for the 1st half

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