New answers tagged

2

This is a basic syntax issue. You are trying to use = operator with two values. May be you wanted to write this, assuming Address field is a text field, AND(NOT(Address = "P.O. Box"), NOT(Address = "PO Box")) As updated if Address is a address type then check for their postal code values is ISBLANK https://help.salesforce.com/articleView?...


1

I'm not going to work out the specifics of what you're trying to do since sfdcfox already did that. I wanted to cover it in general terms. There are two important things to consider when writing a validation rule: The rule's expression specifies the failure conditions Boolean logic has some interesting and only-obvious-when-you-really-think-about-it ...


5

What you're looking for is actually a NOR operation (NOT-OR). Unlike AND, this will only return true when none of the conditions are met. I also shuffled around the operations to make them more performant and legible. However, this changed some of the operations, so let's go over it in pieces. AND( ISNEW(), NOT(Converted_Lead_Contact__c), ... ) ...


3

Validation rules continue to mess with my mind to this day. The thing that keeps tripping me up is that if a validation rule evaluates to true, then the validation rule prevents the dml from completing. It feels like the opposite of what I've been conditioned (through education and experience) to think. If we want to except certain situations from triggering ...


0

The problem is that your actual VR it's just cheking if values are a b c OR d are selected AND and any of the other conditions are true. You have to check conditions one by one with the pick list value selected. Also, you are setting in the VR the logic that is correct, you have to set the incorrect values that make your VR fires, for example: lookup1__c = ...


0

I had the same issue, but it was caused by State and Country picklists. Any edit to the record was triggering ISCHANGED(BillingCountry) or ISCHANGED(BillingState), even though the user was not editing these fields. From page 6: http://resources.docs.salesforce.com/228/10/en-us/sfdc/pdf/state_country_picklists_impl_guide.pdf You can’t use display values in ...


0

Your validation rule wants to be something like: ISCHANGED(Amount__c) && (ISPICKVAL(Status__c, 'Closed') || ISPICKVAL(Status__c, 'Cancelled')) In essence, fail validation when a change is made to Amount in status Closed or Cancelled.


2

You simply need to use backreferences: REGEX(Name,'.*(.)\\1{3}.*') Which reads as follows: .* Any number of preceding characters ( Start numbered capture group . Any one specific character ) End numbered capture group \\1 Backreference to capture group 1 {3} Repeated 3 times (four total instances of the same character .* Any number of subsequent ...


1

If you want to bypass validation rules in certain contexts, a common approach is to use a dedicated user when running the Data Loader - let's call it data-import@myCompany.com. Then rewrite your validation rule as: $User.UserName <> 'data-import@myCompany.com' && OR( AND(MailingCountry = "Other Locations", ISPICKVAL(...


Top 50 recent answers are included