- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 12:20 AM
Hi all,
I'm trying to figure out what code can be used in the Visibility script for Action groups:
The docs only mentions a small piece of code :
answer = context.state.toString() === 'requested';
I've never come across the 'context' object and unfortunately cannot find any documentation on this.
What are my options here?
I can use the above code to show/hide the UI action button on the My Tasks form for certain states.
But I obviously also want to check if the current user is the logged in user.
So should I check g_user against context.opened_by or is context.user a thing?
Please note the also as Action visibility can be set to Visible to self which excludes the state check.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 01:30 AM
So after some testing it seems GlideSystem can be accessed and the context-object is similar to the content of a gliderecord containing each field on the sourcetable as an object.
So getting the field like context.opened_by.toString() works fine and comparing it to gs.getUserID() fulfills my need here.
Hope someone else will find this post useful! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 01:30 AM
So after some testing it seems GlideSystem can be accessed and the context-object is similar to the content of a gliderecord containing each field on the sourcetable as an object.
So getting the field like context.opened_by.toString() works fine and comparing it to gs.getUserID() fulfills my need here.
Hope someone else will find this post useful! 🙂