- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 08:29 AM
Hello All -
I am working on a project that starts with a record producer. On the producer, I have variables for Name and Company. Both fields are of type Reference to sys_users. I want to pre-populate both when the producer loads - name with the Name of the currently logged in user and Company with the company entry off the Company field in the users table.
So far, I have the Name field populated correctly by using javascript:gs.getUserID(); as the default value.
My question is with Company. I've got javascript:gs.getUser().getCompanyID().getDisplayValue(); in as the default value but nothing is displayed.
Before it is suggested, yes, I do have something in the Company field for the account I am testing with.
I would appreciate any thoughts on this issue.
Thank you!
Chris
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 08:45 AM
Chris,
As santosh suggested, change the referencing table from sys_user to core_company, and you need to set the default value to sys_id of the company not the display value.Put this "javascript:gs.getUser().getCompanyID()" in the default value and you are good to go.
Thanks,
Abhinay
Please mark Helpful, Like, or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 08:32 AM
You should change the reference for the company field to core_company.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 08:45 AM
Chris,
As santosh suggested, change the referencing table from sys_user to core_company, and you need to set the default value to sys_id of the company not the display value.Put this "javascript:gs.getUser().getCompanyID()" in the default value and you are good to go.
Thanks,
Abhinay
Please mark Helpful, Like, or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2016 09:23 AM
Looks that that did it... Many thanks to you both!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 01:22 PM
how about only company name?