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
sridhar sridharsridhar sridhar 

Record types restriction

HI, 

we have 15 record types in case object.

do not want to allow to CLOSE/EDIT other records types cases . 

but 3 record types are allowed to close/edit each other cases? 

How to achieve this? 

 
Saravana Bharathi 1Saravana Bharathi 1
Don't assign remaining 12 recordtype to any profile.
Make all the fields read-only at the pagelayout (13 page layouts) which are assigned to corresponding recordtypes.
Write a validation rule to not to edit other 13 recordtype, I have given sample condition.
Error condition formula :(!isNew() &&(RecordType==1 or recordtpe==2........))
Error Message: Don't Edit

If it solves your problem, please mark it as Answer.

Thanks
Arvind KumarArvind Kumar
Hi Shridar,

You should use below condition formula in validation rule. According to, A user can not edit/close other record types(other 12 case record type) cases.
The user can only edit/close case records of remaining three record types.

Validation Condition Formula:
OR(RecordType.DeveloperName = 'Record_Type_Name1',RecordType.DeveloperName = 'Record_Type_Name2',RecordType.DeveloperName = 'Record_Type_Name3',.........................,RecordType.DeveloperName = 'Record_Type_Name13',)
Error Message: You can not edit.

Please implement it.
If you have any issue, you can concern me.

Thanks,
Arvind Kumar
sridhar sridharsridhar sridhar
Hi Arvind, 

Thanks for your reply, 

Can you explain me why you have used DeveloperName in the Validation rule... 
 
Saravana Bharathi 1Saravana Bharathi 1
Developer name gives the unique name of record type.

please refer below link
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_recordtype.htm

Thanks
Arvind KumarArvind Kumar
Hi Shridhar,

When any record type name use in a formula. We are use developer name of the record type. And we can also use record type Id in the formula.

Because Saravana is correct. Thanks

For your knowledge, I have attached some screenshot. This screenshot will help you for better knowledge.
I have used case Object in this screenshot. Please have a look into this.

Case Record Type: I have used case record type for example and use record type API name in the formula.

User-added image
To validation rule: I have used Record type name. Please see below.

User-added image

Either you can use record type Id for build a formula.

User-added image

I hope when you record this message, you will get better knowledge.

If it solves your problem, please mark it the best answer. 

If you have any issue, you can concern me.

Thanks,
Arvind Kumar

 
sridhar sridharsridhar sridhar
Thank Aravind, 

It is a great explanation. 
Arvind KumarArvind Kumar
Hi Shridhar,

If it solves your problem, please mark it the best answer. 

Thanks,
Arvind Kumar