- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018 09:16 AM
Hello,
I have a table and I created a record producer that maps to it. Once of the variables in the record producer which maps to a column in the table is of type Reference and it refers to table "HR Profiles".
What I need is to set the default value of this variable to the HR Profile that is linked to the currently logged user.
I read some articles about implementing this using Catalog Client Script or by making use of the "Default Value" field of the variable, but I couldn't do it.
All suggestions are highly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018 09:32 AM
Hello Mohammad,
On the default value field of your reference variable, just mention the SYS ID of your HR profile.
If you need to fetch the SYS_ID, then you need to write a script include that returns the Sys ID and place it in as default value. For eg
Default value will be
javascript: new HRUtils().getHRProfile(gs.getUserID())
where HRUtils will be your script include and
and getHRProfile is its function that returns the HR profile Sys Id of current user.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018 09:21 AM
Hi,
What have you tried and what do you mean you couldn't do it?
First step would be for us to understand what you've done to assist with troubleshooting or perhaps explaining something.
It would be a waste of time for one of us here to type out a possible solution when it's that very same solution you "couldn't do".
Hopefully I make sense, but we're all about learning here so we want to learn from you, what you've done, then help you learn how to do it correctly.
🙂
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018 09:32 AM
Hello Mohammad,
On the default value field of your reference variable, just mention the SYS ID of your HR profile.
If you need to fetch the SYS_ID, then you need to write a script include that returns the Sys ID and place it in as default value. For eg
Default value will be
javascript: new HRUtils().getHRProfile(gs.getUserID())
where HRUtils will be your script include and
and getHRProfile is its function that returns the HR profile Sys Id of current user.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2018 10:49 AM
Thanks Alikutty K.
This worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 09:08 AM
Is there a way to do this for consumers in CSM? looking at the consumer's name