getMyApprovals() function [OOB Global Business Rule] seems incorrect

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 08:20 AM
Scenario.... I have a user who has 5 approvals waiting for them:
User goes to portal and does this:
User gets this:
Lovely, isn't it?
This is the URL:
So I notice on the "Approvals" widget:
Oh, okay, it's calling the getMyApprovals() function:
Why is this function only querying the sys_user_delegate table??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 09:08 AM
Hello,
This is querying on both the Approvals of user as well as his delegate.
getMyApprovals(); is always retuurning my sys_id as an output along with the sys_id's of my delegates. So the approver is filtered out for my records as well when the following line is executed
gr.addQuery("approver", data.myApprovals);
You can test it by executing this in a background script as.
gs.print(getMyApprovals());
If you carefully look into the delegate Function, the array is initialized with the user added as the first element
answer[i++] = new String(u);
Here u is the user sys_id.
Thanks!