- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 08:45 AM
I have an issue with an UI Action and I'm having trouble figuring out how to debug it. I didn't write the UI action, but I've managed to narrow down the issue to one condition in the UI action, but I'm at a loss on how to determine why it is an issue.
The condition that is not working:
The condition that will work:
The original used to work and I assumed it was an ACL write on the state field, but I've checked and the person who is having the issue passes the ACL write for the state field.
Does anyone have any idea where I should start looking or what might be wrong? This is a scoped app; I did a code search and the only place "canWrite() is used is in the UI Actions, and all of them are current.state.canWrite()
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 09:10 AM
@gjz Strange this. Ideally, the ACL should trigger. Specially when the state.canWrite() is checked. I recommend you to use the Access Analyser to debug this further and check what all ACLs are triggering for the given user on the record being tested. Also check the ACLs on the state field are Active.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 08:49 AM
@gjz canWrite() method checks if the logged in user has write access on a record/field. In your case you are checking it on state field. It seems that there is a field level ACL on the state field which is failing due to which UI Action is not visible.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 09:05 AM
Hi Sandeep,
I don't think my original issue had enough information.
The issue is the UI Action doesn't display when the form opens up.
Here is what I've done:
1. I determined the issue was the canWrite() condition on the UI action by process of elimination.
2. I have checked, there are ACLs on the state field that allow write access for specific roles.
3. I've verified the person has the role required for write access on the state field.
4. I've debugged the ACL, but the write ACL never appears in the debug log - it's like it doesn't exist.
Would you know why the ACL is not getting used?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 09:10 AM
@gjz Strange this. Ideally, the ACL should trigger. Specially when the state.canWrite() is checked. I recommend you to use the Access Analyser to debug this further and check what all ACLs are triggering for the given user on the record being tested. Also check the ACLs on the state field are Active.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 09:17 AM
Thanks Sandeep, I'll try the Access Analyzer. It's a simple ACL, I really don't understand why it won't work. When I look at the ACL, it does find records, including all of the records with the problem.