You can find the logic of child table fetching in SysExtensionSerializerMap::getExtensiontable method:
static void TableExtensionFetch(Args _args) { TableExtensionParent parent; TableExtensionChild child, child2; Query q = new Query(); QueryBuildDataSource qbdsParent, qbdsChild; QueryRun qr; FormRun formRun; Object formRunObject; Args args = new Args(); // Form DataSource args.name(formstr(TableExtensionForm)); formRun = ClassFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait(); if (formHasMethod(formRun, identifierStr(getParentTable))) { formRunObject = formRun; parent = formRunObject.getParentTable(); child = parent.tableExtensionChild(); } parent = null; parent.clear(); child.clear(); child2.clear(); // Joined table 1 select firstonly parent join child where child.TableExtensionParent == parent.RecId; child2 = parent.tableExtensionChild(); parent.clear(); child.clear(); child2.clear(); // Joined table 1 qbdsParent = q.addDataSource(tableNum(TableExtensionParent)); qbdsParent.firstOnly(true); qbdsChild = qbdsParent.addDataSource(tableNum(TableExtensionChild)); qbdsChild.relations(true); qr = new QueryRun(q); while (qr.next()) { parent = qr.get(tableNum(TableExtensionParent)); child = parent.tableExtensionChild(); } parent.clear(); child.clear(); child2.clear(); // packed child.AdditionalField = 'packed'; parent.packTableExtensionChild(child); child2 = parent.tableExtensionChild(); parent.clear(); child.clear(); child2.clear(); // DB select firstonly parent; child = parent.tableExtensionChild(); abs(1); }
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units and "buy me a coffee" link.
Join us.