Using And/Or Expressions in Search Criteria

You can use parenthetical expressions in search criteria that you define for advanced searches and saved searches. When you create expressions, you can define a string of criteria connected by AND or OR logic.

For example, you can search for customers who live near your store location in CA by entering (city is San Francisco AND phone starts with 415) OR (city is Los Angeles AND phone starts with 310) OR (city is San Diego AND phone starts with 619).

NetSuite addresses parenthetical clauses from an order of inside-to-outside. For example, (clause1 AND ((clause2 OR clause4) AND (clause5 OR clause6))) OR clause7. Clauses are addressed in the following order:

          '(clause2 OR clause4)' and '(clause5 OR clause6)' conditions, second '((clause2 OR clause4) AND (clause5 OR clause6))', third '(clause1 AND ((clause2 OR clause4) AND (clause5 OR clause6)))' and in the end '(clause1 AND ((clause2 OR clause4) AND (clause5 OR clause6))) OR clause7' 

        

We can show it on Transaction saved search with these criteria:

          (Type is 'Journal' AND
(Account is 'Sales Orders' OR
Account is 'Purchase Orders' )) OR
Account is 'Estimates' 

        

This search returns all transactions with the Estimates account (does not depend on transaction Type) and all Journal transactions with the Sales Orders or Purchase Orders accounts.

And/Or expressions example.

To define search criteria using expressions:

  1. On the Criteria subtab of an advanced or saved search, check the Use Expressions box.

  2. To indicate that an expression sets criteria for records or transactions that you do not want to include in your results, check the box in the Not column.

  3. In the Parens column, select an opening parenthesis to begin an expression.

  4. In the Filter column, select a field from the record or transaction to set criteria with.

    For more information about defining filters, see Defining Standard Search Filters.

  5. In the popup window, set criteria for your filter, and click Set.

  6. In the Parens column, you can choose to close the parentheses, or you can leave the column blank to add to your expression.

  7. In the And/Or column:

    • Select And to enter criteria in the next line that records or transactions must also meet to be in your results list. Records or transactions must match all criteria you set in a string connected by And.

    • Select Or to enter criteria in the next line to return records or transactions that match criteria in either the first line of criteria or the next line you are adding. Records or transactions can match any criteria in a string connected by Or.

  8. In the Parens column, close your parentheses to end an expression.

  9. Click Add when you have finished a line of criteria.

  10. After setting your criteria:

    • If you are conducting an advanced search, set how you want your results to appear, and click Submit.

    • If you are saving or customizing a search, set how you want your results to appear and set up your available filters, and then click Save.

Important:

If the Use Expressions option is enabled for a search, inline editing is disabled in list, dashboard, and sublist views based on that search. If you want inline editing to be available for a view, ensure that the Use Expressions box is not checked for the search that filters view results.

Related Topics

Advanced Search Criteria Filters
Defining Standard Search Filters
Main Line in Transaction Search Criteria
Summary Search Filters

General Notices