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
❤Code❤Code 

validation rule on object Id

Hi All,

I have a requiremnt where I have 3 custom objects - P__c, T__c, Ts__c.

1. Ts__c has a lookup to P__c.
2. Ts__c has a lookup to T__c.
3. T__c has a lookup to P__c.

Now when I will create record in Ts__c i can see lookup to P__c and T__c.
1. Ts__c is a related list in P__c.
2. T__c is a related list in P__c.
3. Ts__c is a related list in T__c.

I want when i will create a record in Ts__c(related list to T__c) , P__c lookup should get disabled.

Please let me know how to approach this scneario.

Regards
Priya GovindasamyPriya Govindasamy
If by making a field get disabled means Read Only, this can be achieved using Workflow Field update.

Create a Record Type with a pagelayout with the ReadOnly Field. Then use the Workflow FieldUpdate to change the pagelayout with ReadOnly Field.

If this helps, please mark it as Best Answer.
❤Code❤Code
Hi Priya,

Any other way around apart from Record type.

Regards
David ZhuDavid Zhu
Why not simply take out P__c lookup field from page layout  or set it to read only without adding record type? 
Lookup field is not mandatory on page layout but master-detail relationship is.