ProductSyncUtil Class

Knowledge Center > Zuora CPQ > Zuora CPQ Development Resources > Zuora CPQ Component Library > Zuora CPQ Global Classes > ProductSyncUtil Class

ProductSyncUtil Class

The ProductSyncUtil class contains global methods for programmatically triggering product synchronization and cleanups from Salesforce to Zuora. The global methods support the following in the single-entity and multi-entity environments:

  • Synchronizing Products, Features, UOMs, and related objects from Salesforce
  • Deleting Products, Features, UOMs, and related objects in the Zuora product catalog
    When you mark the products and features to be deleted in the Product Sync UI in Salesforce, the syncProducts global method will delete the product in the Zuora product catalog.

ProductSyncUtil Global Methods

The ProductSyncUtil class provides the following global methods to sync or delete products and related objects.

Method Return Type Description


(Integer batchSize)


You can use the method to reduce the number of products to be synced per batch if you are syncing complicated products.

If not set, the default batch size is 50.


(List < ID > ids)

List <ID>

Synchronizes a list of given products and returns the sync history job ids.

If syncing in a multi-entity environment, the method returns the sync history job id in each entity.

The products marked for delete are deleted from the Zuora product catalog by this method.

Code Sample

The sample code calls the syncProducts global method with a set of Product ID's to synchronize. The products and all of their child objects are synchronized to Zuora.

List<Product2> prods = [SELECT Id FROM Product2];
List<Id> productIds = new List<Id>();
for(Product2 prod : prods) {

zqu.ProductSyncUtil util = new zqu.ProductSyncUtil();
Id[] historyIds = util.syncProducts(productIds);
Last modified


This page has no custom tags.


(not set)