Uncovered: How to use SuiteScript to Create Unpublished Saved Searches

This article is relevant if you are seeking to use a NetSuite Saved Search on an object type that does not appear to be supported.

Background

During the development of an extensive NetSuite RESTLet 2.0 integration interface for a client, we encountered a need to get to a couple of objects that were not referenced by the NetSuite records browser.  The goal was to allow users to edit saved searches in the User Interface (UI) so they could fine tune the integration as needed without asking for help from the developers.    The two objects that we focused on was the NetSuite Payment Methods and Currencies.

Using the technique to have an interactive session with the NetSuite UI via the web browser, I crafted the saved search via code.   Thereafter, the saved searches showed up just like any other and could be edited in the UI.  Goal achieved!

Code Snippets to Build Saved Searches

Here are the code snippets I used in the web browser to build the saved search for payment methods and currencies.  These two objects were then refined further using the UI using conventional methods:

var s = nlapiCreateSearch( 'paymentmethod', null, null );
var id = s.saveSearch('vd: api: payment method', 'customsearch_vd_api_payment_method')
id = 939
var s = nlapiCreateSearch('currency', null, null)
var i = s.saveSearch('vd: api: currency', 'customsearch_vd_api_currency')
i = 943

Push on NetSuite Capacities

In working with NetSuite saved search, not all of them available in the UI are available via SuiteScript. ¬†For example, at the time of this writing, the Pricing Saved Search does not work via SuiteScript (a topic for another article). ¬† Yet, just because the Saved Search is not offered in the UI does not mean you can’t get access to it. ¬†The two elements referenced above, “paymentmethod” and “currency”, are not documented. ¬†However, they are still accessible via the API and appear to offer all the services that you would expect. ¬†Of course, we need to be cautious about using capacities that are not documented.

If you are a developer and you assert leadership to extend NetSuite capacities to get the job done, I suspect we would work well together. ¬†Let’s have a conversation.

Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is Southern California's NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 25 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - Google Plus - YouTube

| Tags: , , , | Category: NetSuite, Technical | 1 Comment

One Comment

  1. Posted April 26, 2016 at 4:56 am | Permalink

    One reader asked how to Search or get a List of all the NetSuite Custom Record Types. Here is what to do:

    var s = nlapiCreateSearch( ‘customrecordtype’, null, null );
    var id = s.saveSearch(‘customrecordtypes’, ‘customsearch_customrecordtypes’)

    Get the result of id and go to the list of Saved Searches and you can then modify the output to fit the requirements.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>