Netsuite get Transaction Saved Search Java
<p>I am making an app in java that uses Netsuite's SuiteTalk web services to create a report. I defined a transaction saved search in which I use as a criteria the date and I print in the results the default Transaction columns plus the Department external ID and the sum of the amount. I run the saved search via UI and I get what I am expecting, however, when I try to get the information in my java code I keep getting null results. I have tried the java versions of the following solutions:</p>

<p><a href="https://stackoverflow.com/questions/28467766/c-sharp-netsuite-webservices-get-value-from-custom-field-in-saved-search-items">C# NetSuite WebServices: Get value from custom field in saved search (ItemSearchAdvanced)</a></p>

<p><a href="http://www.anyforum.in/question/web-service/netsuite/How-to-get-data-from-saved-search-through-webservice-request/345" rel="nofollow noreferrer">http://www.anyforum.in/question/web-service/netsuite/How-to-get-data-from-saved-search-through-webservice-request/345</a></p>

<p>However, none of this has worked for me. When I go to the Lists->Search->Saved Searches menu on my Netsuite UI, I am able to see my saved search when I set in the filters "General" and "Transaction". However, I haven't been able to retrieve it's information via API.</p>

<p>This is the code  that I use to try to get the saved search data:</p>

<pre><code>public void printReport() throws ExceededUsageLimitFault, UnexpectedErrorFault, InvalidSessionFault, ExceededRecordCountFault, RemoteException, UnsupportedEncodingException, SOAPException{

        //METHOD 1: Transaction Search
        TransactionSearchAdvanced sr = new TransactionSearchAdvanced();
        //"customsearchreport" is the IF of my saved search
        sr.setSavedSearchId("customsearchreport");
        SearchResult res = _port.search(sr);
        System.out.println(res.getTotalRecords());

        //METHOD 2: Item search

        ItemSearchAdvanced isa = new ItemSearchAdvanced();
        isa.setSavedSearchId("customsearchreport");
        SearchResult resp = _port.search(isa);
        System.out.println(resp.getTotalRecords());

        //METHOD 3: General saved search 

        GetSavedSearchRecord gssr= new GetSavedSearchRecord();
        //I set the record type as "transaction" as I created a transaction saved search.
        gssr.setSearchType(SearchRecordType.transaction);
        GetSavedSearchResult gssre = _port.getSavedSearch(gssr);
        System.out.println("Saved Search status: "+ gssre.getStatus().isIsSuccess());
        RecordRefList srl = gssre.getRecordRefList();
        RecordRef[] rr = srl.getRecordRef();
        System.out.println("RecordRef[] size: " + rr.length);
        for (int i = 0; i &lt; rr.length; i++) {
            RecordRef rref = rr[i];
            System.out.println("External ID: " + rref.getExternalId());
            System.out.println("Internal ID: "+ rref.getInternalId());
            System.out.println("Name: "+ rref.getName());
        }


    }
</code></pre>

<p>With METHODS 1 and 2, I am not able to obtain results (I print "null"). The third method prints me 16 saved searches, however, none of the printed searches correspond to the ones I have created. When I check the saved search list through the UI, I see that there exist 21 non private saved searches and 4 have been created by me. From the 16 reports that are printed, one corresponds to a private saved search. </p>

<p>So, I don't get why I can't get my saved search result and what determines if a report is accessible through any method. Any help to obtain my savedSearch throough the API would be appreciated. Also, could any one explain how Netsuite determines which saved searches appear through any "get" method? </p>

<p>Thanks!</p>