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
Rakesh M 20Rakesh M 20 

Hi All, can any one please tell How can i achieve this in validation rule

fileds :
Status
partsorderlines

I can update the status from Draft to Open only if there are parts order lines. If no lines are associated with should get a validation error saying “this action can’t be performed”
Best Answer chosen by Rakesh M 20
SwethaSwetha (Salesforce Developers) 
HI Rakesh,
Try below validation rule
AND (
ISCHANGED (Status__c),
ISPICKVAL( PRIORVALUE (Status__c), 'Draft'),
(ISBLANK(partsorderlines__c))
)

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Rakesh,
Try below validation rule
AND (
ISCHANGED (Status__c),
ISPICKVAL( PRIORVALUE (Status__c), 'Draft'),
(ISBLANK(partsorderlines__c))
)

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
This was selected as the best answer
Rakesh M 20Rakesh M 20
Thanks Swetha.