I ned to do a small maintenance task on a SS 1.0 s...
# suitescript
n
I ned to do a small maintenance task on a SS 1.0 script to update anew custom field on Item Location Configuration records. Is there something I need to do with this SS 1.0 function. Native fields like 'memo' work OK but not custom fields.
nlapiSubmitField('itemlocationconfiguration', itemWarehouseConfigurationId, 'custrecord_next_po_arrival_date', new Date());
also if I do this one update in SS2.x, it works fine:
var recordId 	= record.submitFields({
type		: record.Type.ITEM_LOCATION_CONFIGURATION,
id			: 128962,
values 		:{
custrecord_next_po_arrival_date :  new Date(),
memo	: new Date()
}
});
hoping to be able to add just my one line, not re-write the script.
l
nlapiDateToString(new Date()) … use this function to convert Date to String
n
@Luiz Morais still the same "UNEXPECTED_ERROR" which only happens when I try the nlapiSubmitField to update free-text custom field on the itemlocationconfiguration record. Native fields I can update.
m
I haven't used SS 1.0 in a bit but if I recall to submit multiple field updates the code would look something like this:
Copy code
nlapiSubmitField(rec_type, rec_id, ['cust_field_id_1', 'cust_field_id_2'], ['cust_field_val_1', 'cust_field_val_1']);
it might be safer to set your new date to a var / let rather than doing it in-line.