I've hit a bit of a wall with this one.
I'm trying to create a Sales Order using SuiteScript 2.1 and it's failing at the record create function.
I'm almost certain the syntax is right but I'm wondering if there's an environment issue or maybe it's just the debugger.
When I run the below code in Script Debugger using 2.1 I get the following error
require(['N/currency', 'N/record', 'N/search'],
function (currency, record, search) {
var salesOrder = record.create({
type: record.Type.SALES_ORDER,
isDynamic: true
})
})
Exception: TypeError TypeError: r is not a function
If I run it in 2.0 it works fine. If I create it in standard mode it also works fine.
I'm starting to wonder if the debugger is buggy!?
Any thoughts would be much appreciated.
Thanks in advance!
UPDATE:
Just testing this by publishing the script and it runs fine. Seems to be an issue with the debugger!
Has anyone else had this sort of issue?