I did some more testing, and I have been able to v...
# suitescript
c
I did some more testing, and I have been able to verify that the same code works in a User Events script but not in a Client script. Can anyone help me try to reproduce this bug or understand if this is standard behavior to not be able to link transactions to new records in a 2.0 Client script? I have tested in a client script as well as in the console, and both return the
INVALID_KEY_OR_REF
error. The console script is just
Copy code
require(['N/record'], function (record) {
  var note = record.create({type: 'note'});
  note.setValue({fieldId: 'title', value: 'Console'});
  note.setValue({fieldId: 'note', value: 'Console'});
  note.setValue({fieldId: 'transaction', value: 'YOUR TRANSACTION ID'});
  note.save();
});