Approvers unable to view approval record after it has been approved

neil_b
Tera Guru

Hello! Our users are running into issues where they are unable to see the approval record after it has been approved. 

 

I tried making modifications to ACLs but was still unable to get it working. I've attached a screen capture of what our users see, when trying to view the approval record for something they have already approved. 

Record Not Found.png

They should still be able to see records they have approved; it shouldn't only be unrestricted when the STATE = REQUESTED. Even if STATE = APPROVED the approver should still have access to view the approval but I haven't found a way to accomplish this.

 

Any help is appreciated!

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @neil_b ,

 

Please follow the steps:

 

1: As an admin, open the approval record form (which was approved and not visible to end user in portal). Table=sysapproval_approver

2: Keep it open in one of the browser tab.

3: In another tab, open the instance and impersonate with the user facing issue. As you said, end users don't use native/desktop UI, so I am guessing they will be redirected to the portal.

4: Reload the browser tab (step 2:) which have approval record form is open.

5: If the record is still visible, it means there is no problem with ACL and before query business rules, which means widget script is causing a problem. If the record is not visible then there can be only two possibilities ACL and before query business rule. If you get the message "Security constraints", it means its ACL is causing a problem. If you get no record found message then before query business rule is causing the problem.

 

I hope this is helpful.

 

Thank you,

Santosh Poudel

View solution in original post

9 REPLIES 9

@Community Alums I followed the steps precisely and my result is that I got "No Record Found" as in my screen capture on the original post. 

Thank you for deciphering this! I tried to find a BEFORE business rule on the sysapproval_approver table or the request table or even global but I couldn't find one. 

 

I did try to do some more digging in the Approval Record widget itself and I see in the HTML script it shows:


<div ng-if="!data.isValid"> ${No Record Found} </div>

 

so I went to find the Server script that referred to data.isValid and found this:

var gr = $sp.getRecord();
if (gr == null || !gr.()) {
data.isValid = false;
return;

}

 

Perhaps the widget script is the culprit here like you suggested? I'm just not sure why $sp.getRecord() is null. The reason why Record Not Found appears is because $sp.getRecord() is null. 

I retested your original scenario here: 

Can you please check if the user can see the approval record(which was approved) in sysapproval_approver table. If the user can see it in native/desktop view but not in the portal, its most likely because of widget script. 

 

and I confirmed that the user CAN see their record in the native/desktop view and CANNOT see their record in the portal so it is definitely because of the Widget Script. 

I see in the HTML script it shows:


<div ng-if="!data.isValid"> ${No Record Found} </div>

 

so I went to find the Server script that referred to data.isValid and found this:

var gr = $sp.getRecord();
if (gr == null || !gr.()) {
data.isValid = false;
return;

}

 

I can't make changes to this widget because it's the OOB Approval Record Widget. I tried cloning it and using it on our approval page but there are too many errors that pop up. 😞 

Community Alums
Not applicable

Hi @neil_b 

 

Cloning widget widget isn't the only thing which needs to be done. There must be other widget which are called/invoked from the cloned widget, you'll have to make changed to the other widget as well.

 

Can you please send the sys_id of OOTB widget. I will look into it and try to find a solution without making any changes to the widget.

 

OOTB widget must be querying in the Approval table and putting some condition/query. If we can make some changes to the Approval record to make the query false, I think we can make things work without making changes to the widget. 

 

Thank you,

Santosh Poudel

Hi @Community Alums the sys_ID of the OOTB widget is '525a2752cb30020000f8d856634c9cfd'

 

Name: Approval Record

 

Thank you for your assistance with this!

 

 

This is where it is querying the approval table on Server Script lines 5-9

	g_approval_form_request = true;
	var gr = $sp.getRecord();
	if (gr == null || !gr.isValid()) {
		data.isValid = false;
		return;

 because if you look at the HTML script, it has this div element on lines 1-3

<div ng-if="!data.isValid">
 ${Record not found}
</div>

neil_b
Tera Guru

I finally found the issue. It wasn't a BEFORE-query business rule; it was an AFTER-query business rule: "Revoke permission after approval". 

 

Thank you @Community Alums !