Discussions
NSC | Resolve Error: "java.lang.StringIndexOutOfBounds.." when Printing Advanced PDF/HTML Template
Use Case:
Users may encounter the following error when printing a transaction using an Advanced PDF/HTML Template:
java.lang.StringIndexOutOfBoundsException: String Index out of Range: 0
This error is commonly caused by empty or invalid field values referenced within the Advanced PDF/HTML Template script or formatting logic.
Reviewing and correcting the referenced fields in the template resolves the issue and allows the transaction to print successfully.
How It Works:
- Navigate to Customization > Forms > Advanced PDF/HTML Templates
- Locate the preferred Advanced PDF/HTML Template and click Edit
- Review the template source code and identify fields or formulas that may contain blank or null values.
Alex Joves | Ask An Expert Live
Ask An Expert Live (AAEL) – An interactive program where Top Contributors share NetSuite expertise, answer your questions, and connect directly with the community. Designed to be informative and engaging, AAEL strengthens collaboration within the NetSuite Support Community. Click here to know more.
