Both entity and entity collection objects support overloadings of the Export( ) and Import( ) methods using a format to store and retrieve object data similar to the ABL WRITE-JSON( ) and READ-JSON( ) methods (respectively) on a temp-table. In addition, these objects support ExportTree( ) and ImportTree( ) methods that export and import an entire object, including all child collections. The ExportTree( ) method is overloaded with a parameter to specify what collections to export. The ExportTree( ) and ImportTree( ) methods use a format to store and retrieve object data similar to the ABL WRITE-JSON( ) and READ-JSON( ) methods (respectively) on a ProDataSet.
The following code exports all tenants in the database into a JSON (.json) file: