Discussions
Retrieve Transaction By EntityID
I need to retrieve a list of transaction for a customer from a button on the Customer Form. From the transaction, I need to transaction number. I'm trying the code below but it is clearly incorrect. I have two problems.
1. When retrieving the entityid in the first line, I get a null value back.
2. Even if I hard-code the entityid, I get no return even though the record does exist.
Any help is appreciated.
Thanks in advance
var customerid = nlapiGetFieldValue('entityid') ;
//alert(customer) ;
var filters = new Array();
filters[0] = new nlobjSearchFilter('customer', null, 'contains', customerid, null);
var searchresults = nlapiSearchRecord('transaction', null, filters, null);