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
SFSF 

Validation rule, Process builder or flow

Can I create a flow or validation rule from a child object to validate 2 fields from a parent object. They have a look up relationship.
I want the sales order (Child Object) to through a error message when
1. opportunity(parent object) is attached AND
2. when sales order reach the status Partially billed, pending billing or billed AND
3. when 2 fields in the parent object are not filled. The 2 fields are Delivery and modality.

Thanks.
Best Answer chosen by SF
AnkaiahAnkaiah (Salesforce Developers) 
Hi,

Try with below validation rule on sales order.

modify the api names as per your need.
AND(OR(Text(Status__c)='Partially billed',
Text(Status__c)='pending billing',
Text(Status__c)='Billed'),
NOT(ISBLANK(Opportunity__c)),ISBLANK(Opportunity__r.Delivery__c),ISBLANK(Opportunity__r.modality__c)))
If this helps, Please mark it as best answer.

Thanks!!