My approver list is not updating automatically

Ansuman
Tera Contributor

When a in change request form request approval button is clicked the approver list is not updating automatically

Ansuman_0-1668671419467.png

but when the refresh list is done 

Ansuman_1-1668671464770.png

then the approver list shows the people 

Ansuman_2-1668671584954.png

how to refresh it automatically or what should i change to avoid this issue

11 REPLIES 11

Community Alums
Not applicable

Can you please paste the whole code here? or do you know from where the approvals are getting populated?

approvals are set from the flow like the action ask for approval has the groups who are asked for approval

Nishant_Kumar
Tera Guru

Hi Ansuman,

I assume your approval is triggered via workflow. And the list which you want to see is related list so OOTB it doesn't get updated automatically if you haven't refreshed the page. So one has to reload. In real time i.e if the process is place and approver is requested and the actual user when he/she will open record the would see the approver has been generated. Still if you want reload once the approver is requested then you can make some customiztion.

Create a field like checkbox etc like 'Approver Requested'- Yes/ No and keep it hidden.
Then you can update it from workflow and write a after update business rules to reload the record by redirecting.

To which page you need to take

sample below

gs.setRedirect('/tablename.do?sys_id='sysid of record'); // this will take to record which is passed


Thanks,

Nishant

'sysid of record' how will i get this like it will be dynamic for all the change request

vikrantsharma
Kilo Guru

Doesn't your Request approval button contains the below code:

 

function moveToAuthorize(){
g_form.setValue("state", "-3");
gsftSubmit(null, g_form.getFormElement(), 'state_model_request_cab_approval');
}

if (typeof window == 'undefined')
updateAndRedirect();

function updateAndRedirect() {
current.update();
action.setRedirectURL(current);
}

 

What you have mentioned looks like some is customized.

 

Also, I still believe you would have to refresh the page as by the time the page is loaded, if the record is not inserted in sysapproval_approver table, it will not show unless it is refreshed.

Please make it correct or helpful if this solves or help you with your issue for other to make use it.

Thanks & Regards,
Vikrant Sharma