Type-Specific Methods¶
These methods are added to objects which support the corresponding semantics.
Not every object has every one, or indeed any, of the below.
Warning
Due to how we implement the Zojo objects, calling one of these methods on an
object without support for it will raise a KeyError rather than the more
typical AttributeError. Please code appropriately.
See also
Please see the official Zoho API References for the purpose and semantics of each object.
Alphabetically¶
Activate()¶
Makes the object “Active”. True on success. Raises ZohoInvalidOpError if
called on a New or List-of object.
Applies To
AddImage()¶
Add an image to an object.
>>> imgname = "imagename.jpg"
>>> mimetype = "image/jpeg"
>>> with open(imgname, "rb") as image:
... obj.AddImage(imgname, image.read(), mimetype)
Applies To
Confirm()¶
Marks an object as “Confirmed”. Returns True on success. Raises
ZohoInvalidOpError if called on a New or List-of object.
Applies To
Deactivate()¶
Makes the object “Inactive”. True on success. Raises ZohoInvalidOpError if
called on a New or List-of object.
Applies To
DeleteImage()¶
Deletes the image associated with an object.
Applies To
Delivered()¶
Marks an object as “Delivered”. Returns True on success. Raises ZohoInvalidOpError
if called on a New or List-of object.
Applies To
Draft()¶
Marks an object as “Draft”. Returns True on success. Raises ZohoInvalidOpError
if called on a New or List-of object.
GetCustomField()¶
Returns the value of a Custom Field. Let’s say you have a Custom Field on your
Items labeled “Bin Location” and named “cf_bin_location” (the Zoho field
placeholder name). Then you can:
>>> item.GetCustomField('cf_bin_location')
A234
>>> item.GetCustomField('Bin Location')
A234
If the Custom Field isn’t part of the object, GetCustomField() returns None.
You can alter that behavior:
>>> item.GetCustomField('Invalid Label')
None
>>> item.GetCustomField('Invalid Label', default="Sup?")
'Sup?'
If the Custom Field list of the object isn’t “custom_fields”, or there’s more than one such list:
>>> item.GetCustomField('cf_bin_location', listkey='item_custom_fields')
A234
Applies To
MakeBundle()¶
Bundles a CompositeItem n-Many times. Provide the number of bundles to make as the first parameter, and optionally these keyword parameters:
bundle_date(string): the date, in “YYYY-MM-DD” format, for the bundles. Defaults to today.purchase_account_id(string): the ID of the corresponding purchase account.warehouse_id(string): the ID of the corresponding warehouse (required if warehouses are enabled).
Applies To
>>> composite.MakeBundle(10, purchase_account_id="9878765432165432109")
Bundle #9876543210987654321
SetCustomField()¶
Updated in v0.6.0: Moved out of Common Methods
New in v0.5.0
Sets the value of a custom field in the object, and returns the object. You pass
either the custom field placeholder or label as the first parameter, and the
new value as the second. SetCustomField() returns the object, so it can be
chained.
If the custom field doesn’t exist in the object, we’ll try to add it. However,
sometimes the Zoho API wants placeholder and sometimes it wants label. so
you have to provide the correct one.
Applies To
UpdateBilling()¶
Updates the related Billing Address of the object.
>>> contact.billing_address.address = "123 New Street"
>>> contact.UpdateBilling()
Contact #9876543210987654321
Applies To
UpdateShipping()¶
Updates the related Shipping Address of the object.
>>> contact.shipping_address.address = "123 New Street"
>>> contact.UpdateShipping()
Contact #9876543210987654321
Applies To
Void()¶
Marks an object as “Void”. Returns True on success. Raises ZohoInvalidOpError
if called on a New or List-of object.
Applies To