I'm a bit baffled on this one right now, and hoping a quick nudge will get my past my wall,
I have a restlet that is intended to update a field on a return authorization record. I am calling the post with the payload of
{'recordtype': 'returnauthorization', 'id': '32664397'} however I get a JS_EXCEPTION error before I get my log indicating I am inside postRec:Error: View System JS_EXCEPTION 1/7/2016 2:25 PM Robert J Hipwell SyntaxError: Unexpected token: r
which seems to me that my payload is being parsed out like an array...Any help on this would be much appreciated.RESTlet: // Create a NetSuite record from request params function postRec(context) { log.debug('Inside postRec'); doValidation([context.recordtype, context.id], ['recordtype','id'], 'POST'); var rec = record.submitFields({ type: record.Type.RETURN_AUTHORIZATION, id: context.id },{'custboy_added_to_magpy':'YUP!'} ); for (var fldName in context) { if (context.hasOwnProperty(fldName)) { if (fldName !== 'recordtype') { rec.setValue(fldName, context[fldName]); } } } var recordId = rec.save(); return JSON.parse(recordId); }Script called via python 3 script: import requests def added_to_magpy_update(ra_int_id): print("Updating added to magpy checkbox for int id: "+ra_int_id) authorization = 'NLAuth nlauth_account=12345,nlauth_email=' + username + ',nlauth_signature=' + utilities.base64_decode_as_string(password) + ',nlauth_role=' + role post_data = {'id': ra_int_id, 'recordtype': 'returnauthorization'} print(post_data) headers = { 'Content-Length': len(post_data), 'Authorization': authorization, 'Content-Type': 'application/json', 'Accept': 'application/json', } r = requests.post(magpy_2016_url, data=post_data, headers=headers, verify=False, cert=None)