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 

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;
   }
}

Sonam_SFDCSonam_SFDC
Could you please check if the ORG has set USD currency as inactive?