2

I have a saved search in Netsuite UI to search the saved searches. I need to execute this saved search and get the results in suiteTalk.

I have called

GetSavedSearchResult savedSearchResult = service.getSavedSearch(new GetSavedSearchRecord() { searchType = t, searchTypeSpecified = true });

on every searchType and the saved search does not appear in any of the results.

Blake
  • 31
  • 1
  • 4

2 Answers2

7

You can access the results of an existing saved search using an Advanced Search web service call. You will need to know the type of record for which the saved search was defined. For example, if you want to get the results of an existing saved search that returns customer records, you can do this:

var search = new CustomerSearchAdvanced();
search.savedSearchId = "243";

try
{
    var searchResult = ns.search(search);
    if (searchResult.status.isSuccess)
    {
        foreach(var r in searchResult.searchRowList)
        {
            var row = r as CustomerSearchRow;
            if (row != null)
            {
                Console.WriteLine($"{row.basic.altName[0].searchValue}");
            }
        }
    }
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}

You can see an example of this on page 271 of the 2016.2 SuiteTalk Plaform Guide. The section is called "How do I reference an existing saved search?"

Mike Robbins
  • 3,184
  • 15
  • 20
  • Sorry about that. I misread the question. I don't immediately see a way to access the results of a "Saved Search" saved search via ST. – Mike Robbins Dec 26 '16 at 21:17
-1

nlapiLoadSearch("record_Type","Internal_Id_of_saved_search");

Hope this solves your problem