I had an opportunity to try the new dynamic mode functionality and after many hours I gave up and could not get it to work.
The documentation shows two examples for using dynamic mode with nlapiGetNewRecord in a beforesubmit script to update some line items. This is my exact use case. Unfortunately, both examples have errors and even when I corrected them nothing was dynamically calculated for me.
In example 2 of the Working with Records page, the last line rec.commitLineItem('item') should be record.commitLineItem('item') and in the example under the following section the last line is record.commitCurrentLineItem('item'). I can't find a commitCurrentLineItem API. I believe it is supposed to be commitLineItem. Even with these changes neither example results in anything calculating dynamically.
When I read the documentation I see it says
If you call nlapiGetNewRecord in a script that was executed in dynamic mode, the data is returned in dynamic mode.
but does not say how to execute the script in dynamic mode. nlapiGetNewRecord does not seem to accept the argument {recordmode: 'dynamic'}. So how do you execute it in dynamic mode? I attempted various ways to get this to work but all failed with various script errors. Has anyone successfully used dynamic mode and nlapiGetNewRecord? I'd sure like to stop having to manually recalculate all the totals on the sales order every time I change any lines.Any working examples would definitely be appreciated!