UI Condition Action

Sam Jae
Tera Contributor

Hi, 

I have a UI Action button that is called "Send For Internal Review" I only want it to load when the "Report Status" variable is changed to "Due" 


The script I have in the condition is (current.reportstatus=="Due") but that is not working and neither is anything else I am trying. 

Please help

1 ACCEPTED SOLUTION

Let me guess your testing scenario: when you got into the Default Report form to create a new record, the Report Status was not Due, we are seeing Due selected there in your screenshot because you clicked the drop down and selected Due. And you expect to see button to show up at this moment?

If that's the case, please note the condition runs at server side. Your change without saving the record won't execute the condition

View solution in original post

8 REPLIES 8

No, sorry it was my fault.
The way that you are setting up it the onclick field is not visible, only when the client is checked.

 

on condition,field is only: current.reportstatus=="Due"

in script field: gs.addErrorMessage('It is a test');

uncheck form button

 

 

DYCM
Mega Sage

Hi @Sam Jae ,

What you have set for UI Action should be correct. If you can't see the "Send For Internal Review" button, the only thing I can think of right now is the condition you put in Condition field: current.reportstatus=="Due".

 

What's the type of reportstatus field?

 

Taking an example of Incident State field, if we want to show the UI Action button when the state is New

We should NOT use: 

 

current.state== "New"

 

Instead, we should use:

 

current.state== 1

 

We should use Value instead of Label1.png

Sam Jae
Tera Contributor

Hi, so here is where we are at. I added a numeric value to the due variable, I changed the script to the current.reportstatus==3 and it still does not pop up. I tried to check and uncheck show insert in case that made a difference. I appreciate all the help so much. I have to figure this out by Monday is anyone can think of anything else I might be doing wrong. Screenshot (13).pngScreenshot (12).pngScreenshot (10).png

Let me guess your testing scenario: when you got into the Default Report form to create a new record, the Report Status was not Due, we are seeing Due selected there in your screenshot because you clicked the drop down and selected Due. And you expect to see button to show up at this moment?

If that's the case, please note the condition runs at server side. Your change without saving the record won't execute the condition