How do I sort the results when querying the NetSuite API?

Through NetSuite SuiteTalk I am trying to retrieve SalesOrder

sorted by field lastModified

. I understand how to search with constraints (see below), but I cannot figure out how to order the results.

    var searchInit = new Func<SearchResult>(() => 
         _client.search(new TransactionSearchBasic
    {
        type = new SearchEnumMultiSelectField
        {
            searchValue = new[] {"_salesOrder"},
            @operator = SearchEnumMultiSelectFieldOperator.anyOf,
            operatorSpecified = true,
        },
        lastModifiedDate = new SearchDateField
        {
            searchValue = sinceLastModified,
            searchValueSpecified = true,
            @operator = SearchDateFieldOperator.after,
            operatorSpecified = true,
        }
    }));

      

Any ideas? Thank!

+3


source to share


1 answer


If I remember correctly, it is not possible to sort the SuiteTalk.
Three possible workarounds:
1) Sort the results in the application,
2) Create a saved search in NetSuite that is properly configured for sorting and then invoke it with SuiteTalk
3) Use a RESTlet and then in SuiteScript it is easy to sort the results (recommended).



+2


source







All Articles