This article describes the OnDemandSyncManager and SyncResult classes that support the On-demand Sync. It include the properties and global methods of the classes.
Zuora.OnDemandSyncManager is the main global Apex class.
The OnDemandSyncManager class includes the following properties.
Indicates whether an email notification should be sent to the current user once the sync request is sent.
The default value is true.
A set of Salesforce IDs.
If the syncObjectType is BILLING_ACCOUNT, this set should contain Zuora__CustomerAccount__c.Id.
If the sync object type is ZPRODUCT, this set should contain zqu__ZProduct__c.Id.
The sync object type. Possible values are:
A set of Zuora IDs.
If the syncObjectType is BILLING_ACCOUNT, this set should contain Zuora Customer Account ID (32-character ID string).
If the syncObjectType is ZPRODUCT, this set should contain Zuora Product ID (32-charater ID string).
|Method||Return Type||Exception Thrown||Description|
Sends the On-demand Sync request to Zuora.
It can be invoked under both a trigger context and a non-trigger context:
Currently, each object sync request is a Salesforce callout. Salesforce allows a maximum of 100 callouts per request. In an
OnDemandSyncManager.sendRequest() call, you can sync up to 100 objects. If the call to
OnDemandSyncManager.sendRequest() is part of a larger transaction, some callout limits might have been consumed prior to the call. When the callout limit is reached, the sync requests for the rest objects will return an error.
When the On-demand Sync is invoked under a trigger context, all Salesforce governor limits on
@Future requests apply.
The SyncResult class includes the status of the On-demand Sync request. This status is not the same as the status of the sync operation.
The SyncResult class includes the following properties.
|jobId||String||The 32-charater sync job ID from Zuora. It is returned only if the sync job successfully completes.|
The Salesforce object name.
The string, 'N/A', returns if there is currently not a Salesforce object associated with the Zuora object to be synchronized.
|statusMessage||String||The status message. If the sync request fails, it contains the error description.|
|success||Boolean||The success or failure status of the sync request.|