kayduh
kayduh

Reputation: 318

creating custom list porlets in netsuite

i have been playing around with making custom portlets in netsuite, but im having some trouble displaying the results from my saved search in to the portlet columns

function customportlet1(portlet, column)
{
    portlet.setTitle('Portlet Test');
    portlet.addColumn('vendtype', 'text', 'Name', 'LEFT');
    portlet.addColumn('account', 'text', 'Account', 'LEFT');
    portlet.addColumn('type', 'text', 'Type', 'LEFT');
    portlet.addColumn('amount', 'currency', 'Amount', 'RIGHT');

    var cols = new Array();

    cols[0] = new nlobjSearchColumn('vendtype', null, null);
    cols[1] = new nlobjSearchColumn('account', null, null);
    cols[2] = new nlobjSearchColumn('type', null, null);
    cols[3] = new nlobjSearchColumn('amount', null, null);

    var results = nlapiSearchRecord('transaction','customsearch1106' , null, 'cols');

    for(var i = 0; i < results.length; i++)
        {
        LogExec("loop " + results[i]);
        portlet.addRow(results[i]);
        }
}

I think im using the porlet.addRows wrong, but im not sure. Going through my debug logs the nlapiSearchRecord is working because it is running the loop 7 times which is the number of results it should be finding. My problem i believe is in displaying said results.

EDIT:

I found the problem, I have the incorrect search filter field internal ID for "vendor : name" its not vendtype. does any one know what it is?

Upvotes: 0

Views: 1195

Answers (1)

Saqib
Saqib

Reputation: 2480

All vendor fields are listed here with their internalId. https://system.netsuite.com/help/helpcenter/en_US/RecordsBrowser/2012_2/Records/vendor.html.

Have you tried altname?

Upvotes: 0

Related Questions