Discussions
Getting customer record info from a client-side script running on Sales Order
We re-purposed this snippet from existing working code, but we can't get back anything from the child customer record of the sales order.
This is part of the function we are running at "save record". The first three alerts display correctly, then NS gives us "cannot submit this form due to an unexpected error" without displaying the customer email alert popup.
function setShipMethodAndCost()
{
var subTotal = nlapiGetFieldValue( 'subtotal' );
var shipMethod = nlapiGetFieldValue( 'shipmethod' );
var customerInternalID = nlapiGetFieldValue('entity');
alert(subTotal);
alert(shipMethod);
alert(customerInternalID);
var filters = new Array();
filters[0] = new nlobjSearchFilter('internalid', null, 'equalto', customerInternalID , null );
var customerRecord = nlapiSearchRecord('customer', null, filters, null );