David Rogers David Rogers - 1 year ago 119
C# Question

NetSuite SuiteTalk: SavedSearch for "Deleted Record" Type

How does one get the results of a "Saved Search" of Type "Deleted Record" in NetSuite? Other search types are obvious(CustomerSearchAdvanced, ItemSearchAdvanced, etc...) but this one seems to have no reference online, just documentation around deleting records, not running saved searches on them.

Update 1

I should clarify a little bit more what I'm trying to do. In NetSuite you can run(and Save) Saved Search's on the record type "Deleted Record", I believe you are able to access at least 5 columns(excluding user defined ones) through this process from the web interface:

  • Date Deleted

  • Deleted By

  • Context

  • Record Type

  • Name

You are also able to setup search criteria as part of the "Saved Search". I would like to access a series of these "Saved Search's" already present in my system utilizing their already setup search criteria and retrieving data from all 5 of their displayed columns.

Answer Source

The Deleted Record record isn't supported in SuiteTalk as of version 2016_2 which means you can't run a Saved Search and pull down the results.

This is not uncommon when integrating with NetSuite. :(

What I've always done in these situations is create a RESTlet (NetSuite's wannabe RESTful API framework) SuiteScript that will run the search (or do whatever is possible with SuiteScript and not possible with SuiteTalk) and return the results.

From the documentation:

You can deploy server-side scripts that interact with NetSuite data following RESTful principles. RESTlets extend the SuiteScript API to allow custom integrations with NetSuite. Some benefits of using RESTlets include the ability to:

Find opportunities to enhance usability and performance, by implementing a RESTful integration that is more lightweight and flexible than SOAP-based web services. Support stateless communication between client and server. Control client and server implementation. Use built-in authentication based on token or user credentials in the HTTP header. Develop mobile clients on platforms such as iPhone and Android. Integrate external Web-based applications such as Gmail or Google Apps. Create backends for Suitelet-based user interfaces. RESTlets offer ease of adoption for developers familiar with SuiteScript and support more behaviors than NetSuite's SOAP-based web services, which are limited to those defined as SuiteTalk operations. RESTlets are also more secure than Suitelets, which are made available to users without login. For a more detailed comparison, see RESTlets vs. Other NetSuite Integration Options.

In your case this would be a near trivial script to create, it would gather the results and return JSON encoded (easiest) or whatever format you need.

You will likely spend more time getting the Token Based Authentication (TBA) working than you will writing the script.