Happy Business Starts Here

Highlighted
Support SME

Getting error "list index out of bounds" when running a ZQuery

Customer is using a zQuery in our future method to fetch "Subscription ID" from Zuora for the matching "Invoice ID". Even though there is a Subscription ID present for a particular Invoice ID, the query is resulting with an "list index out of bounds" exception.






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
Support SME

Re: Getting error "list index out of bounds" when running a ZQuery

Customer was running a zQuery (using Order builder code) in a future method to fetch "Subscription ID" from Zuora for the matching "Invoice ID". 

In reviewing Debug log, it was noticed that the Endpoint was wrong and it was pointing to Zuora Production Tenant.

 

 

15:41:48.14 (454884500)|USER_DEBUG|[25]|DEBUG|ZQuery::Select SubscriptionId From InvoiceItem where InvoiceId='2c92c08555a0a77e0155b4cf6af0185d'
15:41:48.14 (456035332)|USER_DEBUG|[779]|DEBUG|setRequestIdInHeader: requestId=SFDC_00D560000000oEEEAY_005E0000006PT3GIAW_2016-07-20T03:41:48.048Z_0.8457541951133178_0 request=System.HttpRequest[Endpoint=https://zforsf.zuora.com/apps/services/a/72.0, Method=POST]

 

 

Endpoint=https://zforsf.zuora.com/apps/services/a/72.0

Since the end point was pointing to Zuora Production tenant, instead of sandbox, the Subscription was not found and hence the error was thrown.

Correcting the connection setting of Z360 to point to Zuora sandbox Tenant (https://apisandbox-zforsf.zuora.com/apps/services/a/72.0resolved the problem.

 

 

 






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