- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 11:58 AM
Hello team,
I created a Catalog Item form that users can request to activate or deactivate a group, form is completed and the flow is also working fine.
the variable type is Reference, like the image below:
Depending of user selection (Re-Activate or Deactivate) the requirement is to show an error message below field "Name_of_the_Group":
"This group is already activated" or "This group is already deactivated".
I'm struggling to find a way to make this happen, my scripting is beginner...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 12:19 PM - edited 05-13-2024 12:22 PM
On a server script you could just 'dot-walk' to the active field on the sys_user_group table and test this against the deactivate/re-activate variable value. In an onChange Catalog Client Script you can do this using Glide Ajax:
or, since this is a simple case, getReference:
Both of these are excellent tools to have in your belt, so give them a try sometime. In this case, you could also use the newer (Utah) Variable Auto-Populate feature by creating a new variable to hold the active/inactive group value, then hide that variable on the form if you'd like. The advantage here is that your Catalog Client Script would just evaluate this variable's value against the deactivate/re-activate value, without the need for a server call and return in the script!
Let me know if you have questions on any of these approaches.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 12:19 PM - edited 05-13-2024 12:22 PM
On a server script you could just 'dot-walk' to the active field on the sys_user_group table and test this against the deactivate/re-activate variable value. In an onChange Catalog Client Script you can do this using Glide Ajax:
or, since this is a simple case, getReference:
Both of these are excellent tools to have in your belt, so give them a try sometime. In this case, you could also use the newer (Utah) Variable Auto-Populate feature by creating a new variable to hold the active/inactive group value, then hide that variable on the form if you'd like. The advantage here is that your Catalog Client Script would just evaluate this variable's value against the deactivate/re-activate value, without the need for a server call and return in the script!
Let me know if you have questions on any of these approaches.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 05:24 AM
Thank you Brad, I used the Auto-Populate feature and it work just perfect!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 05:27 AM
That's great to hear, and you are welcome!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 06:29 AM
Brad, do you know a script to use on the catalog client script that will show a field message like "valid name" or "Invalid Name" if a value of a variable is True or false?