0

Validation rule criteria: IF the "Is Owner" field =1, then users shouldn't be able to edit "Commission User ID" nor Territory ID.

OR(
(ISCHANGED( Commission_User_Id__c )  || 
ISCHANGED( TerritoryId__c )) and Text(Is_Owner__c, "1"))
  • Hi user49165 (I swear I'm not a robot, that's just your username), welcome to SFSE! As is, I can't tell what your question is actually about. It seems like you've edited your validation rule just fine. Are you getting an error when you try to save it? Does it save, but it's not working as expected? Basically, I'm asking you to provide more details (things like error messages, or examples that explain that you have data X and expect result Y, but you're getting result Z instead). Taking a look through the help center, specifically How to Ask, would be a good idea too. – Derek F Sep 13 '17 at 19:27
  • What field type is Is_Owner__c? – Brian Mansfield Sep 13 '17 at 19:27
0

You have the syntax wrong, and I strongly recommend you don't mix AND/OR with &&/|| syntax, as it often leads to confusion. First of all, the proper usage:

AND(logical1,logical2,...) and replace logical1,logical2,... with the values that you want evaluated.

Same goes for OR:

OR(logical1, logical2...) and replace any number of logical references with the expressions you want evaluated.

So as far as your AND expression goes, your first logical expression would be to check Is_Owner__c="1", and your second logical expression would be an OR clause to check that neither field has changed. Inside your OR clause, each expression would be an ISCHANGED call.

AND(
    Is_Owner__c="1",
    OR(
        ISCHANGED(Field1__c),
        ISCHANGED(Field2__c)
    )
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.