ZSBConnectorUtils Class

Knowledge Center > Zuora CPQ > Zuora Connector for Salesforce CPQ > Global Classes in Zuora Connector for Salesforce CPQ > ZSBConnectorUtils Class

ZSBConnectorUtils Class

ZSBConnectorUtils Global Methods

The ZSBConnectorUtils class contains the following global methods in Salesforce CPQ.

Method Return Type Description
createContractFromOpportunity
(Id opportunityId)
void

Create contracts from contacts - one at a time.

Converts the primary quote to a contract for an opportunity. 

If the Billing Account does not exist in Zuora, this method will create the Billing Account in Zuora.

createContractFromQuote
(Id quoteId)
void

Create contracts from quotes - one at a time.

Converts a quote to a contact.

If the Billing Account does not exist in Zuora, this method will create the Billing Account in Zuora.

syncProductsToZuora
(SET<Id> products)
void Sync products to Zuora.
deleteProductsFromZuora
(SET<Id> products)
void Delete products from Zuora.
sendContractsToZuora
(SET<Id> contracts)
void Send contracts to Zuora.

Sample Code

Send Contract to Zuora

To programmatically send a contract to Zuora, set the Send to Zuora (ZSB__SubscribeToZuora__c) field on the Contract object to true as shown in the code sample below.

A contract is sent to Zuora asynchronously. When the response comes back from Zuora, the Zuora Sync Status (ZSB__ZuoraSyncStatus__c) field on the Contract object will be populated with the results.

Contract c = [select Id FROM Contract Where Id='8003600000086iM' LIMIT 1];
c.SubscribeToZuora__c = true;
update c;

Sync Products to Zuora

See the code sample below for how to programmatically sync products to Zuora.

SET<Id> products = new SET<Id>();
products.add('01tf4000000jLVf');
ZSB.ZSBConnectorUtils.syncProductsToZuora(products);

Delete Products from Zuora

See the code sample below for how to programmatically delete products from Zuora.

SET<Id> products = new SET<Id>();
products.add('01tf4000000jLVf');
ZSB.ZSBConnectorUtils.deleteProductsFromZuora(products);

Send Contract to Zuora

See the code sample below for how to programmatically send contracts to Zuora.

SET<Id> contracts = new SET<Id>();
contracts.add('800f4000000cCgQ');
ZSB.ZSBConnectorUtils.sendContractsToZuora(contracts);
Last modified

Tags

This page has no custom tags.

Classifications

(not set)