var theRecord=record.load({
type: record.Type.SALES_ORDER,
id:12344,
isDynamic: false,
defaultValues: null
});
log.debug("old value",theRecord.getValue({fieldId:'trandate'}));
theRecord.setValue({
fieldId : 'trandate',
value :invoiceDate
});
log.debug("New value",theRecord.getValue({fieldId:'trandate'}));
theRecord.save ();