stalbert
12/10/2021, 3:03 PMSciuridae54696d
12/10/2021, 3:35 PMWatz
12/10/2021, 3:41 PMstalbert
12/10/2021, 3:45 PMsublist.rowsFromSearch( searchid )
that turned that nearly 50 lines of code above into 1 🙂Watz
12/10/2021, 3:47 PMWatz
12/10/2021, 3:50 PMWatz
12/10/2021, 3:53 PMstalbert
12/10/2021, 4:00 PMWatz
12/10/2021, 4:15 PMstalbert
12/10/2021, 4:30 PMNElliott
12/13/2021, 9:37 AMfunction beforeLoadSublist(type, form)
{
if (type=='edit' || 'view')
{
//add a sublist to the form. Specify an internal ID for the sublist,
//a sublist type, sublist UI label, and the tab the sublist will appear on
var contacts = form.addSubList('custpage_contacts', 'staticlist', 'Custom Contacts', 'general');
//add fields to the sublist
contacts.addField('entityid', 'text', 'Name');
contacts.addField('phone', 'phone', 'Phone');
contacts.addField('email', 'email', 'Email');
// perform a Contact record search. Set search filters and return columns for
// the Contact search
var contactdata = nlapiSearchRecord('contact', null, new
nlobjSearchFilter('company', null, 'anyOf', nlapiGetRecordId()),
[new nlobjSearchColumn('entityid'), new nlobjSearchColumn('phone'),
new nlobjSearchColumn('email')])
// display the search results on the Custom Contact sublist
contacts.setLineItemValues(contactdata)
}
}