Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Uncovered: How to use SuiteScript to Create Unpublished Saved Searches

NetSuite Technical

Tags: , , ,

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.

Marty Zigman LinkedIn

Marty Zigman

Holding three official certifications, Marty is widely recognized as a top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. A former Deloitte & Touche CPA and technology executive with CTO roles, he brings over 35 years of leadership in ERP, CRM, and eCommerce business systems. Contact Marty to engage directly.

BiographyYouTubeLinkedInX (Twitter)

5 thoughts on “Uncovered: How to use SuiteScript to Create Unpublished Saved Searches

  1. Is there a way to schedule customer price lists and send the out to them as csv or an advanced html template. I can generate an advanced template and print it manually but can not seem to schedule it.

    Reply
  2. Thanks for your reply. I have managed to create the pricing saved search and email it out as csv. My other question is, is there a way to call (or create) this saved search using suitescript so an external source can get it using a rest api?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *