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
Aruna Dhavaleswarapu 4Aruna Dhavaleswarapu 4 

Validation rule to enforce users to enter all values in a section even if one value is entered in that section

I have 3 fields in a section.
I have to write a validation rule when a value is entered in one field in a section enforce the user to key in values for all other fields in that section.
AND( 

OR(
AND(
(x__c> 0), 
OR(
ISBLANK(y__c),
ISBLANK(z__c)
)
),


AND((y__c > 0), 
OR(
ISBLANK(x__c ),
ISBLANK(z__c)
)
),


AND((z__c > 0), 
OR(
ISBLANK(x__c ),
ISBLANK(y__c )
)
)
),
(RecordType.Name = "abc") 
)

Here is my VR.... Any help would be appreciated.. thanks, 
Best Answer chosen by Aruna Dhavaleswarapu 4
Dev_AryaDev_Arya
I tested this for three fields in my dev org, You can modify this and put the fields accordingly. 
AND( OR( NOT(ISBLANK(BillingCity )) ,NOT(ISBLANK( BillingStreet )),NOT(ISBLANK( BillingCountry ))), 
OR(ISBLANK(BillingCity ),ISBLANK(BillingStreet ),ISBLANK(BillingCountry )))

Mark this post green if  it helps :-).
Cheers, Dev

All Answers

Dev_AryaDev_Arya
I tested this for three fields in my dev org, You can modify this and put the fields accordingly. 
AND( OR( NOT(ISBLANK(BillingCity )) ,NOT(ISBLANK( BillingStreet )),NOT(ISBLANK( BillingCountry ))), 
OR(ISBLANK(BillingCity ),ISBLANK(BillingStreet ),ISBLANK(BillingCountry )))

Mark this post green if  it helps :-).
Cheers, Dev
This was selected as the best answer
Aruna Dhavaleswarapu 4Aruna Dhavaleswarapu 4
Thanks Dev
Your solution resolved the issue.