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

xiaix
Tera Guru

Scenario.... I have a user who has 5 approvals waiting for them:

find_real_file.png

User goes to portal and does this:

find_real_file.png

 

User gets this:

find_real_file.png

Lovely, isn't it?

This is the URL:

find_real_file.png

 

So I notice on the "Approvals" widget:

find_real_file.png

 

Oh, okay, it's calling the getMyApprovals() function:

find_real_file.png

 

Why is this function only querying the sys_user_delegate table??

1 REPLY 1

Alikutty A
Tera Sage

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!