What we need for this:
Assume object A__c is Master and object B__c is Detail and A__c is a lookup field on object B__c
Assume object A__c is Master and object B__c is Detail and A__c is a lookup field on object B__c
- To make the field A__c required we need to write validation on object B and also need to make it require from page layout
- we need to write a written on object A__c that will perform two operation
- once object A__c record gets delated all its child records(B__c) need to get deleted
- once object A__c record gets undeleted all its child records(B__c) need to get undeleted
- if we are using Rollup summury fields on object A__c we need write a rollup summury trigger on object B__c
- Also we need to write criteria if require in trigger B__c to update the parent A__c record field
Code:
- Required field Validation
- ISNULL( A__c )