Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Calling getUserByID() works in global scope but not in application scope

pathat
Kilo Expert

Hello.

I have a business rule (BR) which has a custom script which gets information about a user other than the user I am currently logged in as, just like the following:

var ourUser = gs.getUser();

gs.print(ourUser.getFirstName()); //should print out the first name of the user you are currently logged in as

ourUser = ourUser.getUserByID('abel.tuter'); //fetched a different user   --> Exception thrown here when in APPLICATION scope

gs. ­print(ourUser. ­getFirstName()); //this should be the first name of the user you fetched above

This script was working fine when the BR has a GLOBAL scope. But the same script fails when it calls ourUser.getUserByID() in another BR which has an APPLICATION scope. The error is: TypeError: undefined is not a function

Thoughts anybody?

10 REPLIES 10

Thx Grant!