Zuora Custom Objects provide the service to define custom objects. You can extend the Zuora data model to accommodate your specific use cases with custom objects.
This article describes how to view, create, update, and delete custom object definitions through UI. Once a custom object definition is created, you can create custom object records of this type. See Custom object records for more information.
If you want to access custom object definitions by API, see Custom Object Definitions in Zuora API Reference.
View custom object definitions
To view custom object definitions:
- Navigate through Platform > Custom Objects. The list of custom objects will be displayed.
- Input the custom object name in the search box.
- Click the object name in the search result. The custom object details will be displayed.
Create a new custom object definition
To create a new custom object definition:
- Click + CREATE CUSTOM OBJECT at the top right corner in the custom object list view.
- Fill in the information on the new custom object page. The Name and API Name fields of the custom object are required.
- Click + NEW CUSTOM FIELD.
- You must create at least one custom field for a new custom object.
- You can add at most 50 custom fields to a custom object.
- All custom fields in a custom object can be indexed.
- Input the information of the custom field on the Custom Field page.
- Field Name: The custom field name displayed on UI. The field name is required.
- API Name: The API name of the custom field. The API name must end with
__cand cannot be edited once created. The API name is required.
- Description: The description of the custom field.
- Field Type: Select a field type for the new custom field. See the following possible values of the field type. The field type cannot be changed once the custom field is created.
- Text: You can define the default value for a text type custom field.
- Integer: You can define the default value for an integer type custom field.
- Number: You can define the default value for a number type custom field.
- Boolean: You can select the default value for a boolean type custom field.
- Date: You can define the fault value for a date type custom field.
- Date and Time: You must enter the values for both date and time if you want to define the default value for a date and time type custom field.
- Picklist: You must add at least one option for a picklist type field. You must make sure every picklist value is unique when you fill in picklist values. The picklist value is case-insensitive. For example, "Business" and "BUSINESS" are treated as the same value and cannot both be added. You can set a default value for a picklist type custom field.
- You must select the Namespace for a relationship type field. The com_zuora namespace houses Zuora objects and the default namespace houses the custom objects.
- You must select the Object Name of the object that this custom field is related to.
- Each custom object can contain at most 2 relationship type custom fields.
- The relationship between a custom object and its related object is many-to-one. For example, a custom object of Vehicles could have many records that are related to one Subscription.
- Relationships can be established with Zuora objects or other custom objects.
- The relationship field usually stores the related object's UUID only except for Subscription Name and Rate Plan Charge Number as both of them are unique.
- You can only add relationship type fields to a new custom object or an existing custom object with no records.
- Required: Switch the Required toggle on or off to indicate whether the custom field is required. You can change a required field to optional. However, you can only change an optional field to required on the custom object with no record.
Filterable: Switch the Filterable toggle on or off to indicate whether the custom field is filterable. Only filterable fields can be used as filters in the high-performance queries submitted through the Query custom object records API. However, any field can be used as a filter when using Data Query. You can change the Filterable value through Update custom object definition API after the field is created.
- One custom object can have a maximum of 10 filterable fields.
- The maximum length of each filterable text field must be 512 or less.
- Click the Save and Add Another to save the custom field definition and immediately start creating a new custom field. Repeat until you input the information for the last new custom field. Click Save and Close to save the custom field definition and return to the new custom object page.
- Click Save on the new custom object page.
The new custom object definition will be displayed in the custom object list view.
Note that you should not store PCI, sensitive PII, or other regulated data in custom objects. See Responding to individual requests for access, correction, and deletion of data under applicable privacy laws for more information.
Update a custom object definition
You can make the following updates to an existing custom object definition:
- Edit existing custom field definitions
- Add new custom field definitions
- Delete existing custom field definitions
To edit an existing custom field in the custom object definition, click the custom field name on the custom object detail page. You can make the following updates to an existing custom field definition:
- Update the default value
- Change a required field to optional
- Change an optional field to required if the custom object contains no record
To add a new custom field definition to a custom object definition:
- Click + NEW CUSTOM FIELD on the custom object detail page.
- A custom object can contain at least 1 and at most 50 custom fields
- All custom fields in a custom object are indexed.
- Input the information of the custom field on the Custom Field page. The Field Name and API Name are required.
- Click Save and the new field will be displayed in the field list on the custom object detail page.
- Click UPDATE on the custom object detail page.
Note that you can only add a required field or a relationship type field to an existing custom object with no records.
To delete an existing custom field definition from a custom object definition:
- Click the trash can icon on the right side of the field on the custom object detail page.
- Click YES on the confirmation dialog and the field is deleted from the field list on the custom object detail page.
- Click UPDATE on the custom object detail page.
Note that you can only delete field definitions for custom object definitions that contain no records.
Delete a custom object definition
To delete a custom object definition:
- Click the trash can icon on the right of the custom object in the custom object list view.
- Click YES in the confirmation dialog.
Note that you can only delete the custom object definitions that contain no custom object records. See Custom object records for more information.
View custom objects usage
You can view how many custom objects have been created towards the limit in your tenant by hovering over the Custom Objects Usage meter in the Custom Objects list view.
Import and export custom objects
Click the import/export icon on the left side of the CREATE button in the Custom Objects list view. The import/export menu is popped up with three items:
- Export to JSON
- Copy to Clipboard
Import custom objects
To import custom objects:
- Click the Import in the import/export popup menu. The "Import definitions" window is popped up.
- Paste the JSON format object definitions to the text editor. See the request schema of the Create custom object definitions API for the required JSON structure.
- Click the IMPORT button.
Export custom objects
To export custom objects:
- Select the custom objects that you want to export in the Custom Object list view.
- Click the import/export icon on the left side of the CREATE button in the Custom Object list view. The import/export menu pops up and the Export to JSON and Copy to Clipboard menu items are appended with the number of selected custom objects.
- If you want to export the selected custom object definitions to a JSON file, click Export to JSON. If you just want to copy the definitions to the clipboard, click Copy to Clipboard.
You can then import these selected custom object definitions to another tenant with the exported JSON file or from the clipboard.