Thursday, March 13, 2014

Table and Class

Table variables are declared on the basis of the data dictionary in MorphX; that is, on the basis of the tables, which are declared in the AOT. In most respects, table variables can be considered objects. Contrary to objects, they are not allocated explicitly. Only a variable declaration is required.
All tables are compatible with the Common table in the same way that all objects are compatible with the Object class. Table variables, which are declared as common buffers, can be used to hold data from any table. You cannot access tables without table variables.

public void myMethod()
{
    // Declares and allocates space for one CustTable record
    CustTable custTable;
}

Thursday, March 6, 2014

Event Sequence

Sequence of Methods calls while opening the Form
Form --- init ()
Form --- Datasource --- init ()
Form --- run ()
Form --- Datasource --- execute Query ()
Form --- Datasource --- active ()

Sequence of Methods calls while closing the Form
Form --- canClose ()
Form --- close ()

Sequence of Methods calls while creating the record in the Form
Form --- Datasource --- create ()
Form --- Datasource --- initValue ()
Table --- initValue ()
Form --- Datasource --- active ()

Sequence of Method calls while saving the record in the Form
Form --- Datasource --- ValidateWrite ()
Table --- ValidateWrite ()
Form --- Datasource --- write ()
Table --- insert ()

Sequence of Method calls while deleting the record in the Form
Form --- Datasource --- validatedelete ()
Table --- validatedelete ()
Table --- delete ()
Form --- Datasource --- active ()

Sequence of Methods calls while modifying the fields in the Form
Table --- validateField ()
Table --- modifiedField ()
 

Tuesday, March 4, 2014

Call Form from code

   if (mbsConfigSetting::Boolean(#BD71))
   {
        args = new Args();
        args.name(formstr('mbsbdcustFiscalTable'));
        args.record(custtable);
        formrun = ClassFactory.formRunClass(args);
        if (formRun)
            {
            formRun.init();
            formRun.run();
            formrun.wait();
            }
        }
   }

 Args                args;
    FormRun             formRun;
   args = new Args();
   args.parmEnumType(eNumNum(InventJournalType));
   args.parmEnum(InventJournalType::Count);
   args.record( InventJournalTable::find(this.TaskSourceId));
   formRun = new MenuFunction(menuitemdisplaystr(InventJournalTableCount), MenuItemType::Display).create(args);
   if (formRun)
    {
            formRun.run();
            formRun.detach();
    }