// Export the MyTable records to the xml file static void exportAxdMyTable(Args _args) { MyTable myTable; AxdMyTable axdMyTable = AxdBase::newClassId(classnum(AxdMyTable)); AifEntityKeyList aifEntiryKeyList = new AifEntityKeyList(); AifDocumentXml aifDocumentXml; XmlDocument xmlDocument; // convert a record to the entity key AifEntityKey getEntityKey(Common _record) { AifEntityKey aifEntityKey = AifEntityKey::construct(); List keyFields = SysDictTable::getUniqueIndexFields(_record.TableId); Map keyMap = SysDictTable::mapFieldIds2Values(keyFields,_record); ; aifEntityKey.parmKeyDataMap(keyMap); aifEntityKey.parmTableId(_record.TableId); aifEntityKey.parmRecId(_record.RecId); return aifEntityKey; } ; // add all records to be exported into the entity key list while select myTable { aifEntiryKeyList.addEntityKey(getEntityKey(myTable)); } // create an xml document containg the records aifDocumentXml = axdMyTable.readList(aifEntiryKeyList, null, new AifEndpointActionPolicyInfo(), new AifConstraintListCollection(), connull()); xmlDocument = XMLDocument::newXML(aifDocumentXML); // save the xml document on the disk xmlDocument.save('C:\\Temp\\AxdMyTable_Outbound.xml'); }