Scheduled Script Execution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 05:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 05:24 AM - edited 09-28-2023 05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 05:29 AM
I want to get the users whose company code is equal to 123456 and system code is equal to 4 in the sys user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 05:45 AM
Hi @kack l ,
If I understand correctly then its a very straight forward query right. Assuming company code & system code are present on the User Table itself.
var gr = new GlideRecord('sys_user');
gr.addQuery('company_cd','123456'); // Please use proper backend value for company code
gr.addQuery('system_cd','4');// Please use proper backend value for system code
gr.query();
while(gr.next()){
gs.info(gr.name); // Add your logic here if you want to do anything with those users
}
Please mark my answer helpful & accepted if it helps you resolve your query.
Thanks,
Danish