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
Anusha VankayalapatiAnusha Vankayalapati 

validation rule to make a field read only

Hi Team,
I have a below requirement. Lead record type field should be read only (uneditable) when:
- Lead Record type = Deal
- Lead record type  = Partner.

Please help me in acheiving this.
Thanks.
 
Best Answer chosen by Anusha Vankayalapati
CharuDuttCharuDutt
Hi Anusha
Try Belwo validation
AND( OR(PRIORVALUE(RecordType.Name) = "Deal",PRIORVALUE(RecordType.Name) = "Partner"), ISCHANGED( RecordTypeId ) )
Please Mark it As Best Answer If it Helps
Thank You!

All Answers

CharuDuttCharuDutt
Hii Anusha
Try Below Validation
AND(
OR(RecordType.Name = "Deal",RecordType.Name = "Partner"),
ISCHANGED( RecordTypeId )
)
Please Mark it As Best Answer If it Helps
Thank You!
Anusha VankayalapatiAnusha Vankayalapati
Hi CharuDutt,
Thanks for your response. When I tried this validaion rule, I am not able to change from the other record type 'Standard' to 'Deal' or 'Partner' record type. 

The requirement would be like: 
  • From any other record type, we should be able to change to Deal/Partner record types
  • From Deal/Partner record type, we should not change to any other record type.

Please help here.
CharuDuttCharuDutt
Hi Anusha
Try Belwo validation
AND( OR(PRIORVALUE(RecordType.Name) = "Deal",PRIORVALUE(RecordType.Name) = "Partner"), ISCHANGED( RecordTypeId ) )
Please Mark it As Best Answer If it Helps
Thank You!
This was selected as the best answer
ravi soniravi soni
hi @Anusha Vankayalapati,
try formula of @CharuDutt. It seems good and will work too. let him know by mark it as best answer.
Thanks 
Anusha VankayalapatiAnusha Vankayalapati
Thats so perfect..!! It worked for me.
Thanks CharuDatt. :)