I am trying to do an update on a record. When I call the apply updates I get an error about the strToByteArray method.
adapter.getSQLData(table,"SELECT * FROM PERSON WHERE PERSONID = " + contact.id,
() => {
console.log(table)
table.first()
table.setFieldValue('PERSONFIRSTNAME', contact.firstName)
table.setFieldValue('PERSONLASTNAME', contact.lastName)
adapter.applyUpdates([table], () => {
console.log('Success')
resolve()
}, (err, msg) => {
console.log(err, msg)
reject(err, msg)
})
}, (err, msg) => {
console.log(err, msg)
reject(err, msg)
})
After the getSQLData call, the table does indeed have the single row.
After applying the changes, those changes are stored in the row in the __newValues array.
I have attempted this by selecting only the fields I needed, which were the id, first and last names. So I resorted to globbing the entire row. The documentation for using tableRequestInfo is not present, or I would have tried populating the table via a createTableRequestInfo.
Here is the error I get back:
TypeError: RemObjects.UTIL.strToByteArray is not a function
at Bin2DataStreamer.writeDelta (DataAbstract.js:1691)
at RemoteDataAdapter.applyUpdates (DataAbstract.js:1111)
at ContactService.js:86
at DataAbstract.js:1088
at DataAbstract4_Intf.js:241
at AjaxWrapper.ajax_post_success [as onSuccess] (RemObjectsSDK.js:722)
at XMLHttpRequest.onreadystatechange (RemObjectsSDK.js:1554)
Any help figuring this out would be greatly appreciated, as I only had the sample from the documentation to work with.