require([‘N/currentRecord’],function(currentRecord){
currentRecord.executeMacro({id:’calculateTax’});
});
To calculate the tax inside Netsuite via scripts
// get macros available on the record
let macros = invoiceRecord.getMacros();
// execute the macro
if (‘calculateTax’ in macros) {
macros.calculateTax(); // For promise version use: macros.calculateTax.promise()
}