ANS-0704 · SUITESCRIPT DEVELOPMENT

Why Do NetSuite Suitelets Fail When Called in Testing Mode?

Understand how Suitelet deployment status impacts inter-Suitelet communication and logging in NetSuite.

Short answer

Suitelets calling other Suitelets often require a 'Released' deployment status for proper authorization, as requests in 'Testing' mode are anonymous. Switching to 'Released' defaults the logging level to 'Error', which may ignore 'Debug' level logs. This is crucial for successful inter-Suitelet operations and effective debugging.

Scenario

Users may encounter issues when attempting to call one Suitelet from another while the calling Suitelet is in 'Testing' deployment mode. The called Suitelet may fail to execute, leading to unexpected behavior or errors. This often occurs because the request lacks proper authorization when initiated from a testing environment.

Solution

To ensure proper functionality, especially when one Suitelet calls another, the calling Suitelet must be deployed with a 'Released' status. When a Suitelet attempts to communicate with another Suitelet using N/https module functions while in 'Testing' mode, the request is treated as anonymous. This lack of authorization will cause the called Suitelet to fail.

Therefore, testing inter-Suitelet communication often necessitates deploying the calling Suitelet in 'Released' mode. It is important to note that when a Suitelet's deployment status is switched to 'Released', the default logging level automatically changes to 'Error'. Consequently, any N/log module functions set to 'Debug' level will be ignored, which can complicate troubleshooting. Developers should adjust logging levels accordingly when testing in 'Released' mode.

Expert NetSuite Support

Need help with this NetSuite issue?

SuiteScript Development consulting and configuration support

Talk to a consultant