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?

3
  • 1
    You can check to see if the multi-select is blank with ISBLANK(Services_Purchased__c) Sep 1, 2016 at 13:08
  • Hey if your problem has been resolved please close the question or else update the question
    – Pavan tej
    Sep 1, 2016 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, 2016 at 13:43

3 Answers 3

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.

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))
   )
)
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!

You must log in to answer this question.