Wouldn't you want to add that as a filter on your ...
# suitescript
e
Wouldn't you want to add that as a filter on your search then?
šŸ’Æ 1
c
To make sure I'm thinking the same as you, do you mean • a filter applied during the scripted search? • or some sort of filter applied on a custom search?
e
I'm not sure what you mean when you differentiate "scripted search" vs "custom search"
c
scripted = a suitescript i wrote custom = a search generated using the NS web UI I should have been more clear, since in all reality they're the same under the hood.
if it helps here's the search segment of my script.
Copy code
function find_Orders() {
    nsLog.audit({ title: "Looking up Records" });

    var the_date = "02/26/2019"; //the value from the form field -- currently hard set so there are results to display

    // This will generate the search
    var order_search = nsSearch
      .create({
        type: nsSearch.Type.SALES_ORDER,
        columns: [
          {
            name: "trandate"
          },
          {
            name: "closedate",
            function: "ageInDays", // this funcition gives a numeric result (as in 5) instead of a MM/DD/YYYY
            sort: nsSearch.Sort.DESC
          },
          {
            name: "tranid"
          },
          {
            name: "entity"
          }
        ],
        filters: [
          {
            name: "mainline",
            operator: "is",
            values: ["T"]
          },
          {
            name: "type",
            operator: "anyof",
            values: ["SalesOrd"]
          },
          {
            name: "trandate",
            operator: "on",
            values: [the_date]
          },
          {
            name: "closedate",
            operator: "isnotempty"
          },
          {
            name: "trackingnumber",
            operator: "isnotempty"
          }
        ]
      })
      .run().getRange({ start: 0, end: 1000 });

    // nsLog.debug({title: "", details: order_search});

    return order_search;
  }
e
Yeah if you've already got the full thing scripted, just add another filter to it
šŸ‘šŸ» 1