Hello,
I'm trying to retrieve MAX date value stored in an array. using below code NS throwing error as "_TypeError: Cannot find function max_", need some inputs
for (var y = 1; y <= soitems_count; y++)
{
var soitem_id = soRec.getLineItemValue('item','item', y);
nlapiLogExecution('DEBUG', 'Sales Order Item ID', soitem_id);
soRec.selectLineItem('item', y);
var dates=[];
dates.push(soRec.getCurrentLineItemValue('item', 'custcol_cs_exp_ship_date'));
maxdate = dates.max();
nlapiLogExecution('DEBUG', 'Maximum Date', maxdate);
soRec.setFieldValue('shipdate',maxdate);
}