mkachline
12/05/2016, 6:02 PMvar invoiceDate = new Date(invoiceRecord.getValue({ fieldId:'trandate'}));
var futureDate = new Date(invoiceDate.toString());
futureDate.setDate(futureDate.getDate() + 365);
That said, when I run the above code in the NS debugger, once "futureDate.setDate()" is run, I see the value of both "futureDate" AND "invoiceDate" increment by 365 days.
Bonkers. Why is the value of "invoiceDate" changing in the debugger? I would have thought the "new Date(invoiceDate.toString()) would have effectively decoupled any sort of "variable referencing" going on.