- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:02 AM
I have a request form that needs to auto populate 4 variables based on the user that opened the request. The 4 fields are Project owner name, title, department and phone. These are all fields that exist in the sys_user table. I read through several discussions and found different variations on how to accomplish this, some of them with catalog client scripts but so far I have been unsuccessful with these suggestions. Bhavesh Jain did suggested in a post to use javascript:gs.getUser().getFullName() in the default value field for name and that worked perfectly, but I'm unable to figure out how to get this to work for the other three fields. Any help is appreciated.
Thanks,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 09:11 PM
Hi Chad,
I've attached a simple script include and client script that should do the job for you. You will need to update the catalog client script to the right Catalog Item.
Check the field variable names, but I think you'll find it's all there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 01:07 PM
I'm afraid I may be in way over my head and will need help with that script if you don't mind? My fields are:
sys_user Variable
title po_title
department po_dept
phone po_phone
I'm looking through the script that Pradeep had provided in the previous post and I think that's where I got lost when I originally started researching this.
I'm a little confused on why this would be onChange instead of onSubmit?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 07:49 PM
Hi Chad,
Can I ask a simple question... why are you not just dot-walking to this information after the request is submitted?
For example. current.variables.user.department
Will the department/phone/title ever be different than the one found on the user's profile?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 06:08 AM
Hi Chuck, The requirement is the information be populated and can be updated. This will help maintain the integrity of the user table but allow the users flexibility to update the information if necessary for this request.
Thanks for the scripts, I'm hoping to get to them right away.
Thanks!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 09:11 PM
Hi Chad,
I've attached a simple script include and client script that should do the job for you. You will need to update the catalog client script to the right Catalog Item.
Check the field variable names, but I think you'll find it's all there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 10:04 AM
Hi Chuck,
I have installed the scripts and confirmed all the variable names are correct. I also confirmed that the catalog client script is pointed to the correct catalog item. I ran my first test and the title field did populate, however phone and department did not. I played around with it a bit and couldn't get those two fields to populate. I ran a check syntax on the script include and got a warning message: Do not use JSON as a constructor on the following line: var answer = new JSON().encode(uObj);
Any ideas?
Thanks,