Option Removal for a Variable

Abdul
Tera Contributor

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?

 

4 REPLIES 4

Ravi Peddineni
Kilo Sage

@Abdul 

 

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.

i am not able to dot walk to user's email id in when to apply field.

I tried it 

What field are you using for dot walk in the condition?

sunnyt1
Tera Expert

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.
image.png

sunnyt1_0-1749401394077.png

 


Please mark it as accepted if it works for you.
Thanks