why record.save() take more time if we don't pass enable Sourcing and ignoreMandatoryField parameter in Netsuite's Suite Script 2.0?

Hi All,

I saw one blog online where blogger says that record.save() is taking more time and
record.save({enableSourcing:true, ignoreMandatoryFields:true}).

I want to write about the reason ,
When we use record.save() and pass not parameter then Netsuite native functionality first try to validate sourcing and then check mandatory fields and this cause delay in saving(delay is in parts of second only)
record.save()

but when we define while saving and let Netsuite know that don't check for mandatory fields , Netsuite skip that and it actually save lot of time as there can be 100s of mandatory fields, then sourcing comes, so if we let netsuite know to use sourcing then Netsuite's supporting native sourcing functionalities runs and populate sourced values.
record.save({
                     enableSourcing:true, 
                     ignoreMandatoryFields:true
}).

Netsuite actually process less lines of code and which results in shorter saving time.

** don't forget to add record parameter in suite script 2.0 . 

Thanks
Abhi

Comments