Approve UI Action condition not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 02:40 AM
Hi All,
I am trying to create a new approval UI Action for a specific user role (duplicating the existing sysapproval_approver Approve UI Action). I want to hide this new UI Action from the Change request table which I have got working using
RP.isRelatedList()&&parent.sys_class_name!='change_request'
However as soon as I add more it just shows all the time even on the change table Is there something wrong with my syntax?
RP.isRelatedList()&&parent.sys_class_name!='change_request' && current.state == 'requested' && (gs.hasRole('approval_admin') || isApprovalMine(current))
I have tried a few different ways however cant get this to work
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 03:05 AM
Hi @Kearney
Please use the semicolon in end. I have configured one like this and is working-
!gs.hasRole('sn_customerservice.customer') && gs.hasRole('itil') && current.isValidRecord();
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 03:21 AM
Thanks Amit,
Unfortunately, that didn't work It hides it from CHG approval records with RP.isRelatedList()&&parent.sys_class_name!='change_request' however adding anything after this breaks the condition where it shows all the time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 05:04 AM
I believe the problem is in isApprovalMine(current)). Can you remove it and check?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 05:20 AM
Hi Amit,
In the condition currently that is not in it As soon as I add anything EG && current.state=='requested' it decides to show and not hide it
FULL CONDITION
RP.isRelatedList()&&parent.sys_class_name!='change_request'&¤t.state=='requested'