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
new_bienew_bie 

How to Lock the Record using RecordTypes?

Hi

 

How to lock the record by using record types.

 

can you explai the steps.

 

regards.

Jeff MayJeff May

One of the uses of Record Types is to associate page layouts.  You can create a page layout with Read-Only fields, associate it with the ReadOnly Record type.  When a record of that record Type is displayed, it will use the ReadOnly page layout.

new_bienew_bie
Hi JeffM,

Thanks for immediate response,

in account pagelayout, change the AccountNumber field to Read-only and then save it.
my recordname is john and accountnumber is 897654329.
after that in developer console i type a query

SELECT AccountNumber FROM ACCOUNT.

i got all the records.

is it correct way or not teach me.

regards.
Jeff MayJeff May

That is correct. Now, when users view those records, they will not be able to edit the AccountNumber field.  You will always be able to write a SELECT to retrieve records.

eugene_bmeugene_bm

you can lock the record when the record type changes by creating a workflow approval process.

Or, you can create a page layout where all the field is read-only in page layout and set the page assignment to the record type.

 

 

new_bienew_bie
Hi eugene_bm

can you explain the steps

to lock the record when the record type changes by creating a workflow approval process.

Regards.
eugene_bmeugene_bm

Hey, You have to know first if approval process really is the solution for your request.

Workflow Approval process, as it implies, it will go to approval to lock/unlock the record.

 

 

but just to give you idea, heres how you can do it:

1. Go to App Setup>Create>Workflow and Approvals>Approval Process

2. Select the object where you want to create the approval process.

3. Create new and follow the step by step procedure.