Skip to navigation

Learn how to retrieve auditing records of changes to custom objects, including definitions and records, using a data query.

The following use case retrieves the auditing records of changes to custom objects, including custom object definitions and records.

1

Submit a data query job through UI or API with the following SQL query:

SELECT *
FROM auditobjectchangeevent
WHERE (objecttype = 'CustomObjectDefinition'
OR objecttype = 'CustomObjectRecord')
AND year = 2022
AND month = 11
ORDER BY timestamp DESC
LIMIT 100000
2

Check the status of the query job through UI or Get data query job API operation.

3

Download the query result when the job is completed. See the following example of the query result.

Username,Action,ObjectName,Attribute,OldValue,NewValue,Timestamp
audit-trail@zuora.com,CREATED,ATC,title,,ATC,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,label,,ATC,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.maxLength,,100,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.default,,volume,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,filterable,,"[""Field1__c""]",2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.description,, ,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.label,,Field1,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.type,,STRING,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,required,,"[""Field1__c""]",2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,Field1__c.origin,,custom,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,unique,,"[""Field1__c""]",2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,type,,object,2022-11-04T21:56:19.025Z
audit-trail@zuora.com,CREATED,ATC,object,,ATC,2022-11-04T21:56:19.025Z