I have a variable named email in catalog item. I want to set the value of this variable to current logged in user's email id as a default value. For this i am using " gs.getUser().getEmail()" in the default value field of email variable but it's not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2016 06:34 AM
I have a variable named email in catalog item. I want to set the value of this variable to current logged in user's email id as a default value. For this i am using " gs.getUser().getEmail()" in the default value field of email variable but it's not working. Can any one help me over this ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2016 06:45 AM
You're close, but the default value needs to be prepended with javascript: so
javascript: gs.getUser().getEmail();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2023 09:38 AM
Would you know how to auto populate the email field with the value that's in the user field if the user is not the one currently logged in?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2023 10:36 AM
You'd probably need an onchange client script on your user variable that does a g_form.getReference() and then populates the email variable.