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

Locking related list object record

I have created a custom object 'CaseTask__c'  and it has master detail relation ship with Case object.
When the case status is 'In-Progress', i need to lock the related list custom object record.

As you all know there are 3 ways to lock a record, 

1) Trigger
2) workflow rules
3) Validation rules

Please go through below link.

I have created a record type and associated to a read only page layout. 
And also i have written a workflow rule field update to change the record type of a custom object, when the case status is 'In-Progress'.
Finally activated the workflow rule.

But record type is not changing to read only page layout, after case status changes to In-Progress.  why?

What does your workflow rule look like?  If you are using a formula field on CaseTask__c to determine if the status of the parent Case is 'In-Progress', this won't cause workflow rules to fire, as formula fields aren't stored on a record, they are evaluated when the record is retrieved from the database.
Work flow rule criteria written on Case status is 'In-Progress' then field update of CaseTask__c recordtype field. 
But its not working. 
How are you updating a field on child records when a field on the parent is updated? How would it know which one to update?
So the best option is trigger to change the child object recordtype right?
I don't think you'll be able to do this any other way.
I need to restrict child object record when the parent object status field is 'In-Progress'.  How can i do that?
I think you'll need to write some apex code - you won't be able to use workflow as there could be multiple child objects and the action couldn't know which was the correct one to update.
Venkat Reddy sfdVenkat Reddy sfd
Hi bob_buzzard,
 I have requirement like,
    this is in approval process, whenever final approval action compleates record get approved, that record should be read only. how can i achieve could you please suggest me..

Thanks in advance