UI Action - Condition "SARTWITH"

LucileC
Kilo Guru

Hi All,

I'm trying to create an UI Action for the approvals table, but I have a problem with the condition.

I wanted that my "approve" button shows up when his number start by "PRI".

The current condition is : "current.state == 'requested'&&sysapprovalSTARTSWITHPRI&&sysapproval.state==30"

I saw in the system log that the system didnt recognize the "STARTWITH" :

org.mozilla.javascript.EcmaError: "sysapprovalSTARTSWITHPRI" is not defined.
   Caused by error in sys_ui_action.b825860bdb90001068de2a36ca96195e.condition at line 1

==>   1: current.state == 'requested'&&sysapprovalSTARTSWITHPRI&&sysapproval.state==30

Can you help me to create a condition that will works?

Thanks you

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

Hi,

try something like this;

you need to put AND condition between those;

current.state == 'requested' && current.sysapproval.startsWith('PRI') && current.sysapproval.state == 30

Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron

Hi there,

Starts with in a condition could already be something like:

current.sysapproval.startsWith("PRI")

Looking more at your condition, looks a bit of mix-up using string text in your condition.

Try something like:

current.state == 'requested' && current.sysapproval.startsWith('PRI') && current.sysapproval.state == 30

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

Ankur Bawiskar
Tera Patron

Hi,

try something like this;

you need to put AND condition between those;

current.state == 'requested' && current.sysapproval.startsWith('PRI') && current.sysapproval.state == 30

Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Hi Ankur

Does this work in Paris?

 

Any issue you are facing using this?

It should work as expected.