How to add Group Approval tab on a custom application record related list.

Puneet4418
Tera Contributor

Hi,

 

I am working on a custom application and I want to add Group Approval in the related list of the record. I tried to create a new relationship that "Applies to table" my custom table and "Queries from table" is the Group Approval(sysapproval_group).

Post applying this to my custom record, I am getting all RITM approval records under the group approval tabs.

 

Why all RITM approvals records are visible here and please help me to fix this.

5 REPLIES 5

Voona Rohila
Tera Patron

Hi @Puneet4418 

You can add below related list instead of creating relationship.

VoonaRohila_0-1739426914615.png

 

 

 

Ankur Bawiskar
Tera Patron

@Puneet4418 

then it means you didn't give correct script and query condition.

share the configuration

If my response helped please mark it correct and close the thread so that it benefits future readers.

Hi Ankur,

 

I am using below query:

 

current.addQuery('source_table', parent.getTableName());
    current.addQuery('document_id', parent.sys_id);

@Puneet4418 

try this.

var groupApprovalSysId = '';
var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("document_id", parent.sys_id);
gr.addEncodedQuery('groupISNOTEMPTY');
gr.query();
if (gr.next()) {
    groupApprovalSysId = gr.group.sys_id;
}
current.addQuery('sys_id', groupApprovalSysId);

If my response helped please mark it correct and close the thread so that it benefits future readers.