Anyone have an answer why in client side SuiteScript 2.0, this code gives an error "Invalid transaction reference key 8355" but when I run the same call in 1.0 flavor, it works. Anyone have an idea as to why?
SuiteScript 2.0 (fails)
require(['N/record'], function(record){
var note = record.create({type: 'note'});
note.setValue({fieldId: 'title', value: 'Test'});
note.setValue({fieldId: 'note', value: 'note description'});
note.setValue({fieldId: 'notetype', value: 7});
note.setValue({fieldId: 'transaction', value: 8355});
note.save();
})
SuiteScript 1.0 (works)
var record = nlapiCreateRecord('note');
record.setFieldValue('title', 'Test' );
record.setFieldValue('note', 'note description');
record.setFieldValue('notetype',7 );
record.setFieldValue('transaction',8355);
var recordId = nlapiSubmitRecord(record);
The 1.0 client side SuiteScript runs fine.