Option Removal for a Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2025 04:58 AM
Hi,
Based on the user's email id i,e if the user has email id ending with '@parklandusa.com' then the options of the variable 'expenditure type' which is a Lookup select box gets its value from sys_choice table should display all 3 options like Growth Lease and Maintenance. if the user has any other email id its should not display the option 'lease'
How can we do that?
I tried script include and Client scripts to get the user email id from SI and give it to CS and use g_form.removeOption() as well none if it seem to work.
I saw somewhere for Lookup Select Box we have to use SI and call in the place of Reference Qualifier is this true?
Can anyone please help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2025 08:05 AM
Is this a Catalog Item? If yes, try using UI Policy with condition: "User.email" "contains" "@parklandusa.com". In the If true script, make sure you add the option using: g_form.addOption() and in the If false script, remove the option using: g_form.removeOption().
The catch is you will have to explictly tell system to add and remove options while scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2025 08:18 AM
i am not able to dot walk to user's email id in when to apply field.
I tried it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2025 09:01 AM
What field are you using for dot walk in the condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2025 09:38 AM - edited 06-08-2025 09:51 AM
Hi @Abdul , there is no need to use a Script Include. You can create a new variable of type 'Single Line Text' and auto-populate it using out-of-the-box (OOB) functionality to get the user's email address. Then, you can write your catalog client script.
For your reference, I am attaching image , you can hide that email variable. It's only purpose was to get email address.
Please mark it as accepted if it works for you.
Thanks