zObject Class
This article describes the zObject
class which is a generic object used to encapsulate all Zuora objects such as Account, Contact, and RatePlanCharge.
zObject Methods
The zObject
class includes the following methods.
Method Signature | Description |
---|---|
zObject () | Constructs the zObject class. |
List getArrayValue | Returns an array type field value from the zObject instance. |
String getNamespace () | Returns this zObject type's namespace parsed from WSDL. |
Object getValue (String fieldname) | Returns a non-array field value from the zObject . |
String getZtype () | Returns the Type from the zObject . For example, this method returns "Account" for a zObject of type Account. |
void setValue | Sets an array type field value to the zObject instance. See below for the note about setting a value of a date type field. |
void setValue | Sets a non-array field value to the zObject instance. See below for the note about setting a value of a date type field. |
Order Builder does not support setting the time zone in a date field. When you create or update date fields in Order Builder, leave the time zone out as shown in the second example:
Incorrect:
Zuora.zObject prod = new Zuora.zObject('Product'); prod.setValue('Name','12345678'); prod.setValue('EffectiveStartDate','2010-12-31T00:00:00+03:00'); Zuora.zApi.SaveResult[] sr = zApiInstance.zcreate(new List<Zuora.zObject>{prod});
Correct:
Zuora.zObject prod = new Zuora.zObject('Product'); prod.setValue('Name','12345678'); prod.setValue('EffectiveStartDate','2010-12-31T00:00:00'); Zuora.zApi.SaveResult[] sr = zApiInstance.zcreate(new List<Zuora.zObject>{prod});