- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2019 08:12 AM
Hi All
I've a use case where I want a user to be able to perform a UI Action on a record if that user created the parent of that record.
In my UI Action condition I have the code:
current.u_parent_statement.sys_created_by == gs.getUserName();
Which isn't working - the UI action is available whoever the user is. (u_parent_statement is a Reference to the parent record);
This code:
current.sys_created_by == gs.getUserName();
does work, but doesn't satisfy the use case.
I'm assuming that the dot walk isn't working. Do I need to create a script include function to call from the condition instead?
Regards
David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2019 08:41 AM
Hi David,
yes dot walking will work here; is u_parent_statement a reference field then it should work; don't add semicolon at the end and try once
current.u_parent_statement.sys_created_by == gs.getUserName()
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎08-05-2019 08:18 AM
No dot walking definetely works here, just that you might be using it wrong
Can you log the same and check if the values are coming as expected
Thanks,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2019 08:41 AM
Hi David,
yes dot walking will work here; is u_parent_statement a reference field then it should work; don't add semicolon at the end and try once
current.u_parent_statement.sys_created_by == gs.getUserName()
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎09-23-2021 08:50 AM
Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2021 10:05 PM
Are you using correct field name u_parent_statement
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader