Saravanakumar Saravanakumar - 17 days ago 7
PHP Question

How to get Total number of Records for particular recordtype using Netsuite API?

Any idea how to get total number of records for particular record type using
netsuite api.

recordtype would be a contact,customer,lead,prospect,vendor,othername,partner.

Thanks in advance.

Answer

You could make a search and ask for a column "internalid" with summary type of COUNT. This is how it would look in Suitescript.

var columns = [];
columns.push(new nlobjSearchColumn('internalid', null, 'COUNT'));
var results = nlapiSearchRecord('contact', null, filters, columns);

You could create this search ad-hoc in your PHP script or you could pre-create a saved search and load it in PHP and retrieve the results.

This example is for the record type of contact. Just do the same thing for the other record types.

Comments