Button SQL Syntax

I am trying to add an OR or IN statement for a button on orders, but it doesnt seem to work. Do I need to do something special? 

It was order_Status = 'Draft' but i try to do order_Status in ('Draft','Rejected') or order_Status = 'Draft' order_Status =  'Rejected' neither work. 

  • 0

    Hi Anthony, 

    First thing to check, are the values you are putting in there the actual value in the table? (i.e. If it is a selection field, you're putting in the Code not the Translation)

    Are you trying to make the button only visible on screen where certain situations appear - e.g. when the Order Status is 'draft'. Also note the spelling of the field name "orde_status" and not "order_status" if referring to any field created in the Orders table within CRM)

  • 0

    Hi Anthony,

    Do you get anything reported in the ewareSQL log file when you use the non-working SQL?

    I've used both 'in' and 'or' statements on tab SQL filters without any issue, never on a button though.

    If nothing in the error log, try increasing your SQL logging in CRM to 'All queries over threshold' so you can see exactly what the where clause is being set to as that may answer your problem.