SHARE
TWEET

Untitled

a guest Sep 30th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     -- @pljava
  2.     FUNCTION get_orgs_with_ae(
  3.         iPartitionNum IN NUMERIC
  4.     ) RETURN STRING_ARRAY IS
  5.         orgIds STRING_ARRAY;
  6.         validOrgIds STRING_ARRAY
  7.     BEGIN
  8.         SFSQL SELECT organization_id INTO ARRAY orgIds
  9.         FROM core.ORGANIZATION o
  10.         BY PARTITION {iPartitionNum}
  11.         -- OrgPermissions.HighVelocitySales has index 1758                 : 1758/32 + 1 = 55
  12.         WHERE
  13.             (BITAND(o.permissions55, {cPermissions.get_org_perm_mask_nc(OrgPermissionsHI.HIGH_VELOCITY_SALES_I)}) <> 0)
  14. --         AND  cPermissions.has_org_setting("OrgPreferencesH.HIGH_VELOCITY_SALES_PREF_S")
  15.         AND o.active = '1'
  16.         AND o.status IN ({eOrgStatus.ACTIVE}, {eOrgStatus.TRIAL}, {eOrgStatus.DEMO}, {eOrgStatus.FREE}, {eOrgStatus.NEW});
  17.        
  18.  
  19.             FOR i IN 1 .. CARDINALITY(orgIds) LOOP
  20.                 IF cPermissions.has_org_setting_nc(orgIds[i], OrgPreferencesH.HIGH_VELOCITY_SALES_PREF_S) THEN
  21.                     APPEND ARRAY validOrgIds WITH orgIds[i];
  22.                 END IF;
  23.             END LOOP;
  24.         RETURN validOrgIds;
  25.     END get_orgs_with_ae;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top