Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. (function executeRule(current, previous /*null when async*/) {
  2. sepRecs();
  3. function sepRecs(){
  4. //Retrieve user's company
  5. var userComp = gs.getUser().getCompanyID();
  6.  
  7. var gr = new GlideRecord('core_company');
  8. if (gr.get(userComp)) {
  9. if (gr.u_is_seperated == true ) { //Separated data
  10. gs.log('HGC – Users Domain Separation logged in user is part of company ' + gr.name);
  11. var qc = current.addQuery('company', gr.sys_id );
  12.  
  13. //If can see empty company
  14. if ( gr.u_can_see_empty_cie == true ) {
  15. qc.addOrCondition('company', '');
  16. }
  17. }
  18.  
  19. }
  20. }
  21. })(current, previous);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement