- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 11:05 AM
Hi all,
I have created a field 'cost center' for a catalog item and referenced the values from the cost center table (cmn_cost_center). We have got many customers, so I have added a new reference field 'company' to the cost center table (cmn_cost_center). And referenced cost center table to the above mentioned field. I need to use this variable in multiple catalog items, so i added this to a variable set.
Requirement is, based on the logged in user company, the cost center data should be populated. I have tried multiple reference qualifiers and finally used "javascript: "cost_centre="+gs.getUser().getCompany();" but it doesnt work. Can anyone help me on this.
Thanks,
Rini
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 11:28 AM
Hello,
You would need to use the appropriate field name on the referenced table that has companies referenced to that...
So:
javascript:"name_of_company_field_on_cost_center_table="+gs.getUser().getCompanyID();
Please verify the name of the company field you're using on the cost center table and also please note the correct method used for the GlideSystem API to get the company ID of the user.
Please mark reply as Helpful/Correct, if applicable. 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
‎06-22-2022 11:28 AM
Hello,
You would need to use the appropriate field name on the referenced table that has companies referenced to that...
So:
javascript:"name_of_company_field_on_cost_center_table="+gs.getUser().getCompanyID();
Please verify the name of the company field you're using on the cost center table and also please note the correct method used for the GlideSystem API to get the company ID of the user.
Please mark reply as Helpful/Correct, if applicable. 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
‎06-22-2022 12:52 PM
Hi Allen,
Thank you for your reply. I have updated the reference qualifier based on your comments, unfortunately it dint work.
I have added the company name under the reference qualifier condition, and it worked.
Thanks,
Rini