public void insert() { if (0 != this.TableExtensionParent) { // only insert if the FK is valid super(); } }update
public void update() { if (0 != this.TableExtensionParent) { // only update if the FK is valid super(); } }find
public static TableExtensionChild find( recId _recId, boolean _forUpdate = false, ConcurrencyModel _concurrencyModel = ConcurrencyModel::Auto) { TableExtensionChild tableExtensionChild; tableExtensionChild.selectForUpdate(_forUpdate); if (_forUpdate && _concurrencyModel != ConcurrencyModel::Auto) { tableExtensionChild.concurrencyModel(_concurrencyModel); } select firstonly tableExtensionChild where tableExtensionChild.RecId == _recId; return tableExtensionChild; }findByParent
public static TableExtensionChild findByTableExtensionParent(RecId _tableExtensionParentRecId, boolean _forUpdate = false) { TableExtensionChild tableExtensionChild; tableExtensionChild.selectForUpdate(_forUpdate); if (_tableExtensionParentRecId != 0) { select firstonly * from tableExtensionChild where tableExtensionChild.TableExtensionParent == _tableExtensionParentRecId; } return tableExtensionChild; }
public TableExtensionChild tableExtensionChild() { return this.SysExtensionSerializerMap::getExTensiontable(tableNum(TableExtensionChild)); }
public void packTableExtensionChild(TableExtensionChild _tableExtensionChild) { _tableExtensionChild.TableExtensionParent = this.RecId; this.SysExtensionSerializerMap::packExtensionTable(_tableExtensionChild); }
public static QueryBuildDataSource addDataSource(QueryBuildDataSource _parentDataSource, TableId _tableId, JoinMode _joinMode = JoinMode::InnerJoin) { QueryBuildDataSource qbds; if (null == _parentDataSource || tableNum(TableExtensionParent) != _parentDataSource.table() || tableNum(TableExtensionChild) != _tableId) { throw error(error::wrongUseOfFunction(funcName())); } switch (_tableId) { case tableNum(TableExtensionChild): qbds = _parentDataSource.addDataSource(_tableId); qbds.addLink(fieldNum(TableExtensionParent, RecId), fieldNum(TableExtensionChild, TableExtensionParent)); qbds.fetchMode(QueryFetchMode::One2One); qbds.joinMode(_joinMode); break; } return qbds; }
public void insert() { super(); this.SysExtensionSerializerMap::postInsert(); }
public void update() { super(); this.SysExtensionSerializerMap::postUpdate(); }
public void write() { super(); TableExtensionChild.SysExtensionSerializerExtensionMap::insertAfterBaseTable(TableExtensionParent); }write method of child table triggers first and as a result child record will not be saved as it's insert and update methods does not allow it without correct foreign key.
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.