function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jamie AriasJamie Arias 

Need help with Error: Syntax error. Missing

So far this is what I have come up with
AND(ispickval('Status' NOT, "none"), Len(Text(App))=0 ))
I'm trying to create a validation rule that will not allow a user to create a new case if the 'App' doesn't have an option selected.  The 'status' field is a pick list as well as the 'app' field.  When a case is created the status by default is  new
 
Best Answer chosen by Jamie Arias
goabhigogoabhigo
Its easier when you indent/format it

AND ( ISPICKVAL(App__c, ''), ISPICKVAL(Reason, '' ),
          OR ( ISPICKVAL(Status, 'Closed-Duplicate'), ISPICKVAL(Status, 'Closed-Resolved'), ISPICKVAL(Status, 'Closed-Not resolved'), ISPICKVAL(Status, 'Closed-Not feasible') )
)

Try now?

All Answers

goabhigogoabhigo
Is this applicable only for new cases or existing case as well?

Only for new cases - AND ( ISNEW(), ISPICKVAL(App__c, '') )
For new & existing cases - Better make the field mandatory from Page Layout or from Field Level.

I don't see why you need to use/check for Status values. Let me know if this works.

--
Abhi
Arpit Jain7Arpit Jain7
Hi Jamie,

Try below in your validation rule

AND(ISBLANK(Text(Status)),ISBLANK(Text(App__c)))

Let me know for any issues.

Thanks
Arpit

Please mark this answer as SOLVED and BEST ANSWER if it helps you.
Jamie AriasJamie Arias
This is applicable to a new case, ideally, when the case is created, they shouldn't be able to save without the required information.
goabhigogoabhigo
Glad it helped. Thanks for marking it as best answer!
Jamie AriasJamie Arias
ok I made a mistake, I need the picklist field 'status' when updated to 'Closed-resolved, "-not resolved, "-not feasible, etc ' to require or not allow user to save if 'app' field and 'case reason' is not selected.
Jamie AriasJamie Arias
I tried this:
AND (IsClosed(), ISPICKVAL(Reason, '') )

 but I get the following:
Error: Unknown function IsClosed. Check spelling.
goabhigogoabhigo
Not clear, can you elaborate please?

If my understanding is right, you want to make App & Case Reason fields to be mandatory when Status value is Closed-Resolved, Cloased-Not Resolved, Closed-Not feasible ? If yes, then try the following..

AND ( ISPICKVAL(App__c, ''), ISPICKVAL(CaseReason, '' ),
          OR ( ISPICKVAL(Status, 'Closed-Resolved'), ISPICKVAL(Status, 'Closed-Not resolved'), ISPICKVAL(Status, 'Closed-Not feasible'))
)

I don't understand what is the use case of ISNEW() now, hence removed. 

If you are able to understand what I have given/replied, I guess you can modify your validation rule according to your need. Please let me know if you need any more clarifications.

--
Abhi
goabhigogoabhigo
Ohh, so you want to ensure Case Reason is selected when case is closed??

There are 2 ways - 
  1. Make the Case Reason field mandatory from the Closed Case Page Layout
  2. Write validation rule - AND (IsClosed, ISPICKVAL(Reason, '') )

--
Abhi
Jamie AriasJamie Arias
Thanks for your I'm very new and the formulas give me the hardest time, I try to add one more status but I'm getting:
 Error: Syntax error. Missing ')'
your formula worked, but when I modified I got the error, where am I missing the ')'?
I used the following,
AND ( ISPICKVAL(App__c, ''), ISPICKVAL(Reason, '' ),
          OR  ( ISPICKVAL(Status, 'Closed-Duplicate')( ISPICKVAL(Status, 'Closed-Resolved'), ISPICKVAL(Status, 'Closed-Not resolved'), ISPICKVAL(Status, 'Closed-Not feasible')))

)
goabhigogoabhigo
Its easier when you indent/format it

AND ( ISPICKVAL(App__c, ''), ISPICKVAL(Reason, '' ),
          OR ( ISPICKVAL(Status, 'Closed-Duplicate'), ISPICKVAL(Status, 'Closed-Resolved'), ISPICKVAL(Status, 'Closed-Not resolved'), ISPICKVAL(Status, 'Closed-Not feasible') )
)

Try now?
This was selected as the best answer
Jamie AriasJamie Arias
thanks got it
Jamie AriasJamie Arias
whoops sorry *Jamie Arias* System Support Analyst Build It Green 510-590-3360, Ext. 116