com.glide.script.RhinoEcmaError: "RP" is not defined. Warnings in logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2021 07:07 AM
I have a very simple ACL which has a role and a script.
Users are 'passing' the role part of the ACL with no issue, but getting denied write access to the field when evaluating the script part of the ACL.
In the script I have:
answer = !JSUtil.nil(RP.getParameterValue("sysparm_modal_override_acl"));
That url parameter is present and set to true on the Glide Modal window on which the field is located.
The logs show warnings for "RP" is not defined. If I do a gs.info(RP.getParameterValue("sysparm_modal_override_acl")) however that log returns true. (So this proves that the parameter is there?)
The field is allowing the user to make changes to it (i.e. it is not greyed out), but when they try to save the form the changes do not go through; also the field watcher logs show that write access is false to the same field:
Any ideas what could be causing this? Perhaps getting overwritten somewhere?
Edit: Also might be worth mentioning that I have logged the RP object in the ACL and the param
sysparm_modal_override_acl=true
is there too... so why is the ACL denying access??
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2021 07:49 AM
Hi,
RP won't work in ACL script
Can you try this
var value = gs.action.getGlideURI().getMap().get('sysparm_modal_override_acl');
if(value == 'true')
answer = true;
else
answer = false;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2021 08:11 AM
Hello and thank you for your suggestion,
I have just tried your script and unfortunately it does the same thing.
It allows me to modify the field (it is not greyed out), but when I try to save the form the change does not save.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2021 08:18 AM
Hi,
Please enable debug security rules and check
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2021 01:54 AM
I have enabled this, it shows that script is returning answer is false