function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nabil711nabil711 

Creating an Active Account with the zcreate() Call

Hi

 

I try to creat a customer account for zuora from salesforce where is the problem?

 

Zuora.zApi zApiInstance = new Zuora.zApi();
zApiInstance.setEndpoint('https://www.zuora.com/apps/services/a/27.0');
zApiInstance.zlogin('mylogin', 'mypassword');

Zuora.zObject acc = new Zuora.zObject('Account');

acc.setValue('Name', 'nomClient');
acc.setValue('Currency', 'USD');
acc.setValue('BillCycleDay', 1);
acc.setValue('PaymentTerm', 'Net 30');
acc.setValue('Batch', 'Batch1');
acc.setValue('Status', 'Draft');

List<Zuora.zObject> objs = new List<Zuora.zObject> {acc};

List<Zuora.zApi.SaveResult> results = zApiInstance.zcreate(objs);

for (Zuora.zApi.SaveResult result : results)
{
   if (result.Success)
   {
     //get the newly created id
     test = result.Id;
   }
}

 

Thanks