
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 10:44 AM
Hello,
I'm trying to build a condition for a UI Action that essentially says "if the RITM state is not closed skipped, closed complete, or closed incomplete" show this UI Action.
Below is the only way I can think of doing it (that actually works):
current.state != 3 && current.state != 4 && current.state != 7
What I want to do (which doesn't work) is:
(current.state != 3, 4, 7)
What I've tried (Which didn't work):
(current.state != 3 || 4 || 7)
(current.state != 3, 4, 7)
Obviously there's no huge benefit to this beyond cleaning up the code a bit, but I'm just curious if anyone out there has found a way to do this cleaner than adding a bunch of && conditions like this.
Thanks in advance to anyone that contributes!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 09:07 PM - edited 10-16-2023 09:08 PM
Hi @Michael McNulty ,
From the conditions, I can see that we only display the button when RITM is Active. So you can simplify the condition as.
current.active;
Also, we can define a function in a script include and call in the Condition box.
Sample:
new CatalogUtils().isVisible(current.getValue('state'));
isVisible: function(state){
return state !== '3' && state !== '4' && state !== '7';
},
You can also try some other ways around like
"3,4,7".indexOf(current.state) == -1;
Let me know if it works for you.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 03:26 PM
I did a little searching on this. What I'm finding is this is not going to be possible. If conditions are longer/more complex, using a Script Include to validate is a better option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 09:07 PM - edited 10-16-2023 09:08 PM
Hi @Michael McNulty ,
From the conditions, I can see that we only display the button when RITM is Active. So you can simplify the condition as.
current.active;
Also, we can define a function in a script include and call in the Condition box.
Sample:
new CatalogUtils().isVisible(current.getValue('state'));
isVisible: function(state){
return state !== '3' && state !== '4' && state !== '7';
},
You can also try some other ways around like
"3,4,7".indexOf(current.state) == -1;
Let me know if it works for you.
Cheers,
Tai Vu