- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 11:43 AM
We have a form with custom fields. How can I conditionally set the default value of one of the fields based on the another column value in the form? Although maybe not best practice, I am trying to simply use the following script in Configure Dictionary > Advance View > Default Value. The value would be hard-coded to a specific user name if u_enhancement_type is equal to 'ABC', the default value when selected from ABC catalog.
javascript:if (current.u_enhancement_type("ABC")) current.u_business_system_analyst_1 = 'FirstName LastName';
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 12:49 PM
here you go..
javascript:if (current.u_enhancement_type=="ABC")
current.u_business_system_analyst_1 = 'FirstName LastName';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 12:00 PM
If the field u_business_system_analyst_1 is not a reference you can use the above code you mentioned.
If that field is a reference field you need to use this gs.getUser().getUserByID('ron.kettering').getID()
Mark the answer as Correct/Helpful based on its impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 12:45 PM
Would the glide script be used after the equal (=) sign?
Such as,
javascript:if (current.u_enhancement_type("ABC")) current.u_business_system_analyst_1 = gs.getUser().getUserByID('ron.kettering').getID()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 12:49 PM
here you go..
javascript:if (current.u_enhancement_type=="ABC")
current.u_business_system_analyst_1 = 'FirstName LastName';