Is it an invalid operation to POST a recordType: t...
# suitescript
b
Is it an invalid operation to POST a recordType: transfer using SuiteScript N/record?
c
By POST, are you referring to the HTTP method? That's not applicable to N/record. Are you wanting to create a Transfer transaction with the N/record module in a server script of some kind?
🤔 1
c
You should share your code or explain further. Makes no sense
b
Oh yea sorry, using a SuiteScript RESTlet, I’m getting an invalid operation when I try to record.create() a transfer transaction. Is there a way around this?
c
@Bill He Please share your code and more details about context / the error
b
Hi @Clay Roper, Thanks for your help! The SuiteScript 2.1 code that I’m trying to run where the error occurs is:
Copy code
record.create({ type: "transfer", isDynamic: true, });
The specific error is
Copy code
{\"type\":\"error.SuiteScriptError\",\"name\":\"INVALID_OPERATION\",\"message\":\"That operation is not supported for this record type: transfer\",\"id\":\"\",\"stack\":[\"Error\n    at suitescript/resources/javascript/record/recordImpl.js:40:12\n    at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n    at suitescript/resources/javascript/record/recordImpl.js:26:29\n    at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n   "],\"cause\":{\"type\":\"internal error\",\"code\":\"INVALID_OPERATION\",\"details\":\"That operation is not supported for this record type: transfer\",\"userEvent\":null,\"stackTrace\":[\"Error\n    at suitescript/resources/javascript/record/recordImpl.js:40:12\n    at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n    at suitescript/resources/javascript/record/recordImpl.js:26:29\n    at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n  "],\"notifyOff\":false},\"notifyOff\":false,\"userFacing\":true}
c
@Bill He Your message says
search.create({ type: "transfer" })
but your error is about creating a record. Did you mistype the first part?
b
Oh shoot sorry lemme edit, I copy and pasted the wrong one
c
Without more details / proof on the part of the poster, we don't know for sure that Bill.com creates transfers. They might utilize Journals or some other method of achieving the same goal.
b
Yea that you mentioned make sense. It seems like the transfer transaction type was added in after other transaction types have already been productionized.