You need to sign in to do that
Don't have an account?
the customer account can not be saved because it references a currency that is inactive salesforce
the customer account can not be saved because it references a currency that is inactive salesforce
Zuora.zApi zApiInstance = new Zuora.zApi();
zApiInstance.setEndpoint('https://www.zuora.com/apps/services/a/27.0');
zApiInstance.zlogin(xxxxx', 'xxxxxx');
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;
}
else {
//failure
Zuora.zObject[] errors = result.errors;
for (Zuora.zObject error : errors) {
String errorCode = (String)error.getValue('Code');
String message = (String)error.getValue('Message');
//more code here...
test = errorCode+' '+message;
}
}