CustomObjectDynamicSelectionV2 and Dynamic archives to fetch information from extra tables.
Get available fields for the Contact archive
One of the first things to determine is which relations companies have inside the SuperOffice database. The best way is to use the ArchiveGetAvailableColumns endpoint to get all the available columns, including relational columns, for the Contact.
contactExtra/{ExtraTableName}/{FieldName}.
When relations exist between extra tables, these will be shown as contactExtra/y_rentals/x_contact_id/x_equipment/x_name.
When known, search using either the GetArchiveListByColumns or GetArchiveListByColumns2 archive method.
Example
The following example searches two extra tables, y_rentals and y_equipment.y_equipment in this case contains different items we are renting out. y_rentals is the link table between the available items and the companies, and functions as a registry of which items are rented out to which customer.
The following query can be used to find out which items a specific customer has rented:
Notice the
Restrictions parameter. The contactExtra fields can be used as restrictions, additional criteria, to search for customers that have rented a specific item.Make sure to adjust PageSize according to your use case.Get available fields for the CustomObjectDynamicSelectionV2 archive
TheGetAvailableColumns archive can also be used to get all the available columns, include relational columns, for an extra table.
Using the dynamic archive provider to search for extra table information
By using the Dynamic archive it’s possible to search for data directly from the extra tables. The below example has an extra table y_log, and builds up an OData query to select the fields and filter the request by the x_ticket field.While this method is efficient for querying data in extra tables, it should NOT be used if an existing archive provider already handles the same information - for example, the Contact archive.