-2

I am trying to create new Validation rule in "Call" object with field Attachment_placed_on_the_call__c as checkbox for the following requirement:

If Interaction Type is "Reactive" we need to have a validation Rule that if user has not selected "Attachment placed on the call" the call cannot be Submitted. (Call can be saved)

Please find the attached image for created Validation Rule and receiving the syntax error. So,can somebody please help me in modifying this VR.

Thanks, Rudraswamy enter image description here

2
  • 1
    Please edit your question to include the validation rule and error as text rather than as an image. An image alone is less accessible than text, and forces people to transcribe it to text themselves if they want to answer. The harder you make it for people to help you, the fewer people will be willing to help.
    – Derek F
    Commented Jul 11 at 13:48
  • Also, you should take the basic debugging step of formatting your formula according to best practices. Basically, put individual functions/comparisons onto their own lines and indent appropriately instead of mashing things into a single line.
    – Derek F
    Commented Jul 11 at 13:51

2 Answers 2

1

The error you're getting isn't the root of the problem here.
There are 3 issues:

  • You're mis-using the AND() function in the middle of your formula
  • You're missing a comma after the check on the attachment field
  • Your final use of ISPICKVAL() is incorrect (look at the first ISPICKVAL(), do you notice the difference?)

Also note that <boolean/checkbox field> = true can be reduced to simply <boolean/checkbox field>. It's already a boolean value, there's no need to compare it to true.
Likewise, <boolean/checkbox field> = false reduces to NOT(<boolean/checkbox field>) or !<boolean/checkbox field> (! being the other way to perform a logical "not" operation)

1
  • Thankyou for providing information. Commented Jul 12 at 7:38
0

AND is a function, so it needs to be used as such.

AND(cond1, cond2, cond3, ...)

So, your validation rule should look like:

AND(
  ISPICKVAL(Interaction_Type__c, "Reactive"),
  NOT(Attachment_Placed_On_Call__c),
  ISPICKVAL(OCE__Status__c, "Submitted")
)
1
  • Thank you for rectifying the Validation rule. @sfdcfox Commented Jul 12 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .