Rusty Shackles
Rusty Shackles

Reputation: 2840

NetSuite SuiteScript 2.0 - How to use context.newRecord in dynamic mode

I am trying to figure out how you can specify that context.newRecord be in dynamic mode. I have a beforeSubmit UE script and I need the record to be in dynamic mode.

In 1.0, I can just do nlapiGetNewRecord({recordmode: 'dynamic'}); but if I tried context.newRecord({isDynamic: true}), I get an error.

Upvotes: 1

Views: 3402

Answers (1)

Shea Brennan
Shea Brennan

Reputation: 1132

Unfortunately, you appear to have taken advantage of an undocumented feature within SS1.0:

enter image description here

SS2.0 shows the type as DeferredDynamicRecord (the same as record.load({...isDynamic:false})) vs. DynamicRecord as you get when using record.load({...isDynamic: true})

Even worse, the context object appears to contain a copy of the newRecord object, and is not (at least at the time it's available to us) actually executing an api call to retrieve it.

All signs point to you can't edit the newRecord object in dynamic mode in either of the *Submit methods.

Upvotes: 2

Related Questions