How to make state field read only in approval table when request is approved or rejected

Anirudh_saraf
Tera Contributor

Hi Community,

 

There is a custom table which triggers approval after record is created. The requirement is when this approval record is approved or rejected the state field should be read only

 

Thanks

9 REPLIES 9

Sandeep Rajput
Tera Patron
Tera Patron

@Anirudh_saraf Please create two table.* Read ACLs as follows on your custom table.

 

1. table.* write ACL for condition when Approval is None/Requested/Not yet Requested. This allows editing the record

Screenshot 2024-07-02 at 6.03.55 PM.pngScreenshot 2024-07-02 at 6.04.02 PM.png

 

2. 1. table.* write ACL for condition when Approval is Approved/Rejected. This makes the record read only if the approval is approved/rejected.

Screenshot 2024-07-02 at 6.06.08 PM.pngScreenshot 2024-07-02 at 6.06.15 PM.png

Apart from these two ACLs, please deactivate the existing table.* write ACLs on the table.

 

Hope this helps.

Hi @Sandeep Rajput  Thanks for sharing the details.

 

When the record is created in the custom table approvals will be triggered and it is to sysapproval_approver table. 

In the related lists below we can see multiple approvals being triggered and initally they will be in requested state. Once the approver manually changes the state to approved or rejected for that particular record the state field should become readonly inside that.

So the  two ACL's that we have to create will be on sysapproval_approver table?

 

Also If we implement these ACL on sysapproval_approver table this will effect all other tables where approvals are requested . Is my understanding correct? Thanks  

@Anirudh_saraf Could you please confirm if your custom table extends the task table? If yes then the approval field will automatically be inherited on your custom table. And you can create the previously suggested ACLs on your custom table itself. 

Anirudh_saraf
Tera Contributor

The Custom table extends Change request table.

Anirudh_saraf_0-1719924963842.png

The requirement is as shown in the image. If a particular record when in requested state is approved or rejected then that particular state field should become readonly.

 

@Anirudh_saraf In this case the ACL needs to be defined at sysapproval_approver table. Regarding your concern related to other table records, in your ACL, you need to add one more condition and dot walk to approval for to check the Task type and select the name of your table in the drop down. This will allow you to only apply the ACL on your custom table records.

 

Screenshot 2024-07-02 at 6.36.54 PM.png