function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ashok S 7Ashok S 7 

how can i give edit access when the record meet the criteria

Hi guys,
I have one requirments .Responsible object and contains status and response fields are there.
When the status is equal to accepted or not accepted then i want to give edit access to the user for response field.
How it is possible please help me.
RohRoh
Hello Ashok,
We can achieve this requirement in the below way.
1.Create two different Page Layouts [Edit pagelayout, view pagelayout] and two different record types [editRecordType and ViewRecordType]
2.Edit Pagelayout contains the edit button and assign this layout to editRecordType at the object level.
3.View Pagelayout, remove all the buttons and assign this layout to ViewRecordType at the object level.

Option 1 :
Write a Workflow Field Update on this Responsible object.
1.status is equal to accepted or not accepted then assign/update the record type .
2.For this assignment try to get the recordType id and then assign it in the Field Update WF Rule.

Option 2:
Trigger:
1.Create an After Update/ After insert trigger.
2.Change the record type on the field based on meeting the criteria.

PLEASE SELECT THIS AS BEST ANSWER,IF YOU LIKE IT.

Thanks,
Rohit Alladi
 
David ZhuDavid Zhu

Ashok, I think you may use VF page plus controller extension to implement that.
Rendering of 'Reponse' field is based on the value of 'Status' field.

If using apex:inputtext, you can control the field by assiging different value of 'disabled' attribute.