Happy Business Starts Here

Sfdc Error in quote generating using Custom button

Highlighted
Zuora Support

Sfdc Error in quote generating using Custom button

Problem:

Dear Zuora Team,

we are contacting you due to an error we are currently running into in Sandbox environment.
In the feed page of a sales order (object name == zqu__Quote__c), it happens that when clicking the button ‘Genera Plico’ (in English: generate contract) it appears the error in print1 attached.

The contract’s template is stored in Zuora: there is an integration between Saleforce and Zuora to get the contract. The problems consists that Saleforce correctly calls Zuora but Zuora is unable to answer. The response we get is:

{
"success" : false,
"processId" : "1F23EB837E557AB5",
"reasons" : [ {
"code" : 57030000,
"message" : "There has been an unknown internal error happened. ({0})\n"
} ]
}

On the contrary, if we try to generate the contract by clicking on ‘generate PDF’, the system manage to create it without any error (print2).

Please could you help us as soon as possible?

 

Solution:

 

On checking, there were two issues in the custom settings which is used in the PDF generation customization in Salesforce.

 

Issue:

1. End point used to obtain quote template was wrong. It just points to Zuora sandbox URL.

2. baseUrl used in "ServerURL" field is wrong.

 

Capture1.JPG

 

FIX done:

1. According to the Document - https://www.zuora.com/developer/api-reference/#tag/Quotes-Document

the URL should be "https://rest.apisandbox.zuora.com/v1/quotes/document"

 

2. By the below query in the Developer console, we can get the ORG's URL

 

String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
system.debug('baseUrl is --->'+baseUrl);

 

13:44:43:005 USER_DEBUG [2]|DEBUG|baseUrl is --->

 

https://orgname--Partial.cs110.my.salesforce.com

 

 

Customer was missing cs110 in his URL which is the instance ID.

Hence the URL is changed from 

"https://orgname--partial.my.salesforce.com/services/Soap/u/10.0/00DO00000xxxxx" to

 

"https://orgname--partial.cs110.my.salesforce.com/services/Soap/u/10.0/00DO00000xxxxx"

 

Then user can able to generate the quote PDF using his custom button.






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