See example below on how implement mandatory fields in dialog: boolean ret; FilePath workFolder; Dialog dlg; DialogField dfWorkFolder; FormStringControl fsc; FormGroupControl fgc; ; dlg = new Dialog( “@CDT135” ); dfWorkFolder
Some times we need to create a new unique index or alter existing one, but table may already contain duplicate data for this index and our changes could not be
Use table method orig(). It returns the orig buffer which is the committed version of the record in the database.
Example: myTable_ds.object( fieldNum( myTable, myField ) ).visible( false );
Override FormDataSource method executeQuery: public void executeQuery() { SomeTable T = this.cursor(); select * from T where …; } But be aware that in this case grid will not support
Override method firstField on a form, and call after super method setFocus of a control which should focused after form is opened. Example: public void firstField(int _flags=1) { ; super(_flags);
It is impossible to create EDT from X++ using standard AOTAdd. AOTCompile causes Axapta crash and than unstable work. AOTSave method virtually doesn’t save anything. Solution: Use export/import methods. Steps:
TreeNode::isValidObjectName( ‘Object name’ );
Searching in AOT groups like Classes, Forms, etc. by scanning tree nodes is unacceptable due to performance reasons. For searching in AOT groups you should scan system table UtilElements. See
Code in form’s outer scope: TmpTable tmpTable; FormRun formRun; ; … // Fill tmpTable with data here … args.record( tmpTable ); formRun = classFactory.formRunClass( args ); formRun.init(); formRun.run(); formRun.detach(); formRun.wait();