Discussions
Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Get ready to take on exciting new challenges and become the next SuiteMaster of the Month!
AI capabilities embedded across the suite help boost productivity and give leaders an edge by helping them analyze data faster and generate unique insights that drive better decision-making. Watch these on-demand webinars to see how our AI capabilities can help you.
Streamline Invoice Processing with AI-Powered Automation
Use AI-Driven Insights for Faster, Better Planning and Forecasting
Streamline Invoice Processing with AI-Powered Automation
Use AI-Driven Insights for Faster, Better Planning and Forecasting
Error When Conditionally Loading Custom Modules in SuiteScript
Hello everyone!
I am working to optimize the performance of User Event Scripts applied to transactions, written in SuiteScript 2.1. During my debugging, I discovered that significant delays occur when my script loads certain Custom Modules, which are also written in SuiteScript 2.1 and function as libraries. To enhance performance, I want to load these Custom Modules only when they are essential.
Here's how I tried to conditionally load the modules based on examples from other forums:
if (formScriptId === 'custform_test') { require(['../../path_to_lib/lib'], (lib) => { lib.beforeSubmit(context, formScriptId); }); }
Alternatively:
if (formScriptId === 'custform_test') { const lib = require('../../path_to_lib/lib'); lib.beforeSubmit(context, formScriptId); }
0