Syntax to create Search for Custom Record type

The following sample creates a search for a custom record type.

To search for a custom record type, you must specify a type of search.Type.CUSTOM_RECORD and add the ID of the custom record type (as a string).

In this sample, the ID of the custom record type is 6.

The custom record also includes a custom field named custrecord1.

require([‘N/search’], function(search) {

  var myCustomRecordSearch = search.create({

    type: search.Type.CUSTOM_RECORD + ‘6’,

    title: ‘My Search Title’,

    columns: [‘custrecord1’]

  }).run().each(function(result) {

    // Process each result

    return true;

  });

});

Leave a comment

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