Happy Business Starts Here

Zuora Support

Err on generating Quote PDF- java.lang.StringIndexOutOfBoundsException: String index out of range: 0

Problem - You are trying to generate the Quote PDF and getting the error as shown below. 

Screen Shot 2019-04-22 at 1.05.45 PM.png






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY 1
Highlighted
Zuora Support

Re: Err on generating Quote PDF- java.lang.StringIndexOutOfBoundsException: String index out of rang

Solution - Customer was trying to generate the Quote PDF and on some of the Quotes they were getting the error mentioned in the Problem statement. 

 

This error usually occurs when any of the field in the Quote template returns a '0' value. In this specific case customer had orders enabled, when I checked the Quote template, I found that the below merge fields were there on the template-

 

Screen Shot 2019-04-22 at 1.08.16 PM.png

 

When I checked the Quote on which the error was occuring, I could see that the fields `Delta TCB` & `Delta TCB Tax` were Null. Since the Quote was sent to Zuora already, we were not able to calculate these values again and debug further. Advised the customer to add these fields to the Quote Metrics section going forward. 

When we manually added the $0 value to these fields (which was the expected value) the Quote PDF was generated without any issues. 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √