1

I want to make it so that only accounts with a Type of "Client" or "Client - Group Contract" can have services. The "Type" field is a picklist, while the "Services" fields are multi-picklists. I want the multi-picklists to be blank on accounts that aren't clients.

I can do this, without errors in syntax:

AND(NOT(ISPICKVAL( Type, "Client")), NOT ISBLANK(Services_Purchased__c))

But this doesn't work:

AND(NOT(ISPICKVAL( Type, "Client", "Client - Group Contract"))), NOT ISBLANK(Services_Purchased__c, Services_Licensed__c)))

I'm getting the idea that I can't do this with ISPICKVAL, but considering the types of fields I'm working with, what else can I use?

  • 1
    You can check to see if the multi-select is blank with ISBLANK(Services_Purchased__c) – Jeremy Nottingham Sep 1 '16 at 13:08
  • Hey if your problem has been resolved please close the question or else update the question – Pavan tej Sep 1 '16 at 13:38
  • I've already updated the question- that was only one of two problems, unfortunately, and my main problem has yet to be resolved. – user34868 Sep 1 '16 at 13:43
1
AND(
NOT(OR(ISPICKVAL(Type, "Client"),ISPICKVAL(Type, "Client - Group Contract"))), 
NOT(AND(ISBLANK(Services_Purchased__c),ISBLANK(Services_Licensed__c))))

This translates into:

If Type is not "Client" or "Client-Group Contact", and both Services_Purchased__c and Services_Licensed__c are not blank, throw a validation error.

| improve this answer | |
1

You can't put multiple options in the ISPICKVAL function. Only one at a time can be evaluated. So any other logic needs to be implemented with AND and OR statements.

If I understand correctly, this is what you want: "if the record is not a client (and of the 2 types), then both services fields have to be blank."

This would result in the following formula:

AND(
   NOT(ISPICKVAL( Type, "Client"))
   ,
   NOT(ISPICKVAL( Type, "Client - Group Contract"))
   , 
   OR(
      NOT( ISBLANK(Services_Purchased__c))
      ,
      NOT( ISBLANK(Services_Licensed__c))
   )
)
| improve this answer | |
0

Here is how I would write it.

AND(
OR(
NOT(ISPICKVAL(Type, "Client")),
NOT(ISPICKVAL(Type, "Client - Group Contract"))),
NOT(ISBLANK(Services_Purchased__c)))

Give that a shot!

| improve this answer | |

Your Answer

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