- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:16 AM - edited 11-29-2023 03:21 AM
Hi all,
I have a list collector that needs to filter the Cost center table on the current user's company. I want to do this in a reference qualifier if possible.
javascript:"u_company=" + gs.getUserID().getValue('company');
The above returns no results at all (and I know the current user has a company).
I have tried a number of similar things, none of which return a value (or in one case it returns records with company = none).
Edit: I thought it might be a syntax error and changed to:
u_company=javascript: gs.getUserID().getValue('company');
No change, though it may have something to do with the syntax.
Many thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:51 AM
I removed getUniqueValue and your code worked perfectly:
javascript: 'u_company=' + gs.getUser().getCompanyID();
Do you need to enter getUniqueValue when you make such a query? Curious, in that case.
I wonder why getValue('company') did not work in this case.
Anyway, thanks a lot, I have to mark my own post as solution but you have been very helpful!
/Kim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:37 AM - edited 11-29-2023 03:40 AM
Hi @kim-lindgren ,
getCompanyID() | Returns the company sys_id of the currently logged-in user. | var companyID = gs.getUser().getCompanyID(); |
Try this script
javascript: 'u_company=' + gs.getUser().getCompanyID().getUniqueValue();
Please mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 05:42 AM - edited 11-29-2023 05:44 AM
Yes getUniqueValue() not required i forgot to remove.In above mentioned table i removed that but forgot in script.
Please mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:51 AM
I removed getUniqueValue and your code worked perfectly:
javascript: 'u_company=' + gs.getUser().getCompanyID();
Do you need to enter getUniqueValue when you make such a query? Curious, in that case.
I wonder why getValue('company') did not work in this case.
Anyway, thanks a lot, I have to mark my own post as solution but you have been very helpful!
/Kim