Happy Business Starts Here

Support SME

Quantity not updating for RatePlanChargeData in zamend call

In a specific case, although the RatePlanChargeData is included in the object that is passed to zamend, updated quantity is not being included in the Zuora request. Please check below for the solution.






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Support SME

Re: Quantity not updating for RatePlanChargeData in zamend call

The 'RatePlanChargeData' was set as an object, not array in the apex code

Zuora.zObject ratePlanData = new Zuora.zObject('RatePlanData'); 
ratePlanData.setValue('RatePlanChargeData', ratePlanChargeData);

From the schema setup page, we can find 'RatePlanChargeData' is an array on 'RatePlanData' object.

The right way is:

ratePlanData.setValue('RatePlanChargeData', new 
Zuora.zObject[]{ratePlanChargeData});






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

1 REPLY 1
Highlighted
Support SME

Re: Quantity not updating for RatePlanChargeData in zamend call

The 'RatePlanChargeData' was set as an object, not array in the apex code

Zuora.zObject ratePlanData = new Zuora.zObject('RatePlanData'); 
ratePlanData.setValue('RatePlanChargeData', ratePlanChargeData);

From the schema setup page, we can find 'RatePlanChargeData' is an array on 'RatePlanData' object.

The right way is:

ratePlanData.setValue('RatePlanChargeData', new 
Zuora.zObject[]{ratePlanChargeData});






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post