3

This is somewhat subjective, so opinion based, but my recommendation is to have dedicated validation rules for specific checks. It means the user can be guided better, and you can have the validation associated with a field. In terms of best practice, where possible have the validation only apply to initial setting and subsequent changes of the values of ...


2

Right-click on the validation rules folder for the object, and click SFDX: Retrieve Source from Org.


2

Firstly, if you format your validation rule formula more like this, you might be able to follow it better: AND( OR( TEXT(PRIORVALUE(Status)) = 'Esc', TEXT(PRIORVALUE(Status)) = 'Pending' ), NOT(ISNEW()), OR( $Profile.name = 'Pro1', $Profile.name = 'Pro2' ), NOT(isTrue) ) Secondly, here is the documentation for ...


1

If it's a number field, the validation rule can be: Field < 1000 || Field > 9999 This also gives you the ability to fine tune it to say, just a certain range of years. If it's a text field: NOT(REGEX(Field, "^\\d{4}$")) Which is pretty literal. The regex matches any four digits (but nothing else), and since rules fire when true, it is then ...


1

It fires because both Manager__c and TeamDirector__c are not null, so both ORs return true, thus the entire rule returns true, given this is not a new record and at least one field was changed. This should not be one validation rule, but at least two (preferably four, if I understand your intent), one for each field being validated. Trying to combine rules ...


1

You might find it easier to think of this logic in a positive sense - what is a good value rather than what is a bad value, then slap a NOT() around it all to make it a validation rule that returns TRUE when invalid. E.g.: NOT(ISBLANK(theField__c) || REGEX(theField__c, "def-[0-9]+")) Over all your expression would be NOT(boolean_field__c) &&...


1

Jira issue numbers are not fixed 4 digit values which will cause you problems. To check that the value is a prefix, a hyphen followed by a number use regex like .{2,3}-[0-9]{1,5} to allow for 2 or three character prefix, a hyphen then between 1 and 5 numeric digits. You might like to actually use [A-Za-z]{2,3}-[0-9]{1,5} as the regex if you always use upper ...


1

Either use an OR function or || operator, correct syntax for both would be: OR(Condition1, Condition2) Condition1 || Condition2 Whereas you have written it as OR(Condition1 || Condition2), that is not valid. Indenting formulas can be extremely helpful in finding some trivial issues with syntax. This is an example of formula with AND/OR functions to improve ...


1

You want to use an AND for the top level comparison and an OR for the remaining items that cannot be included if the first is selected. Like this: AND( INCLUDES(theField,"b"), OR ( INCLUDES(theField,"a"), INCLUDES(theField,"c"), INCLUDES(theField,"d")) ) Note: I left b out of the OR ...


Only top voted, non community-wiki answers of a minimum length are eligible