Tai Vu
Kilo Patron

Hi @El Cuchi 

I'm not entirely sure what you're trying to achieve, but here are a few things you might want to check

1. setPreference

gdw.setPreference('sys_id', g_form.getUniqueValue());

Add this line below inside the <g:evaluate>, and you can get the passed value from the UI Action.

var currentRecord = RP.getWindowProperties().get('sys_id') || '';

 

2. Correct the table

var approver = new GlideRecord('sysapproval_approver'); //Querying the sysapproval_group table to get the groups are still pending for approval

I'm understanding that you wanna query to the sysapproval_group instead of sysapproval_approver. So it should be:

var approver = new GlideRecord('sysapproval_group');

 

3. The number field.

The sysapproval_approver table does not have a number field. Make sure you're querying the right fields:

group_approval.addQuery('number',approver.group);

 

Cheers,

Tai Vu