GlideRecord query in Condition field for BR or UI Action?

bdr529
Mega Contributor

Hello,

On our Change, Release and Features forms I have UI Action form buttons that will apply an Approve or Reject for anyone in the Approvers related list for that item. What I was hoping to do is to only show those form buttons for the users who actually have an approval for that item at that time, just like the isApprovalMine() function does on the sysapproval_approver table.

Admittedly, I was surprised that one Business Rule actually does have a GlideRecord query in its condition line (Update Config on MID) but I'm not sure if I'm able to modify that to make use of the isApprovalMine() function, which I think would be ideal for this scenario!
That Business Rule's condition is: new GlideRecord("ecc_agent").get(current.ecc_agent)

Does anyone have a suggestion or have maybe done something like this before?

Not a big deal, I know, but I'd like to reduce confusion and polish this up a bit!

Thanks for your thoughts,
Tim

5 REPLIES 5

bdr529
Mega Contributor

Aaaah, great thoughts! I really like the idea of off-loading to a script include or global BR - I'm already finding other uses for this hasRelevantApprovals idea in a few tables so your idea there would make it much more portable. I hadn't known about the setLimit - I will be sure to utilize that! Oh, I also hadn't known the difference between GlideAggregate vs GlideRecord and I can see where they are both important. Just when I'm feeling like a pseudo expert in my instance I learn 5 things in a day that bump me back to feeling newbie 😉

Thanks for the great reply, CapaJC !