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
EdithEdith 

Account validation rule

Hi,

 

I need to create a validation rule to ensure leads can be converted even if the address is incomplete. 

 

I have a validation rule on the account preventing it to be saved without an address and need to update it to allow leads to still be converted if part of the address is missing.

 

NOT(ISNEW()),
OR(ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode))

 

This formula allows me to converta  lead without a full address but of course doesn't do the job as I can still save an account without an address. 

NOT(OR(
ISNEW(),
or(ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode))))

 

Can you please assist? 

 

Thank you!

Best Answer chosen by Admin (Salesforce Developers) 
EdithEdith

Ok, I tried an IF as well and it works:

IF(
ISNEW(),
FALSE,OR(ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode)))

 

Happy days! Thank you Steve

 

All Answers

Steve :-/Steve :-/

Which edition of SFDC are you on?  What if you created a custom field on the Lead (like a checkbox set to TRUE) then map that to a custom ceckbox field on the Account and add the Account.Checkbox field to your VR.

 

Like

 

NOT(ISNEW()),
CheckBox = FALSE,
OR(
ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode))

 

EdithEdith

Thanks Steve, I'm on Enterprise edition. 

I will try your solution, I wanted to avoid creating additonal fields but I guess I will have to if I can't get around it. :)

 

Thanks again

Edith 

 

 

Steve :-/Steve :-/

No problem Edith, I was thinking maybe using a WFR but let's see if we can avoid that.

EdithEdith

Ok, I tried an IF as well and it works:

IF(
ISNEW(),
FALSE,OR(ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode)))

 

Happy days! Thank you Steve

 

This was selected as the best answer
Steve :-/Steve :-/

Really?!? That worked in a VR?

EdithEdith

Yes, I tried an if before but had put the False at the end of the formula instead of within the IF statement. tested it thoroughly and it's all good. Pfeww...

Steve :-/Steve :-/

Doh!!!  I forgot my AND...

AND(
NOT(ISNEW()),
CheckBox = FALSE,
OR(
ISBLANK( BillingCity ),
ISBLANK( BillingStreet ),
ISBLANK( BillingPostalCode)))

 

Steve :-/Steve :-/

Glad you got it sorted out

 

PS.  You owe me a beer!  ;-D

EdithEdith

Sure! <{:-)