Sunday, September 8, 2013

Form Method


FormDataSource.Init
This method initializes the data source and is called from the super() of FormRun.Init(). The method is only called once when the form opens. The main task for this method is to initialize the query used for fetching data. To modify or replace the query automatically created by the form, do this after
the super() call of this method.

FormDataSource.InitValue
This method is used to initialize a new record with default values. The super() of this method calls the initValue() method on the underlying table. If you have initialization that applies system-wide, put the code on the table.

FormDataSource.Active
This event is called when a new record becomes active in the data source. This method is typically overridden to change properties which depend on the contents of the current record: Commonly this method will:
Modify permissions to the data source
Modify permissions to the fields
Enable/Disable buttons

FormDataSource.LinkActive
This method is the engine that joins data sources. This method is called on the joined data source every time that the active record in the main data source is changed. The method is also called when the form is opened as the system tries to join the calling data source to the main data source of the called form.

FormDataSource.ValidateWrite
This method validates an insert or update of a record. The super() of this method calls the corresponding method on the underlying table. If you need to distinguish between an insert and update, make a condition on the RecId field, which only has a value if it is an update.

FormDataSource.Write

This method controls the insert and update of records. The super() of this method calls the corresponding method on the underlying table. If you have form-specific tasks to perform in relation to the commitment of the record, add it here.

Friday, September 6, 2013

Update Recordset


VendTable vendTable;

    ttsBegin;

    update_recordSet vendTable

        setting VendGroup = "GEN"

            where vendTable.VendGroup == "CORPORATE";

    ttsCommit;

Monday, August 26, 2013

Cardinality and Related Table Cardinality

The Cardinality property corresponds to the notation on the child table (SalesLine in this case). So it should be ZeroMore (0...*). RelatedCardinality property corresponds to the notation on the parent table (SalesTable). So it should be ExactlyOne (1…1).

Semantically, Cardinality specifies how many instances of SalesLine row can be related to a single instance of SalesTable row. ZeroMore means that for every sale order, there can be zero, or more sales lines related to it. If the business requirement dictates that you need to have at least one sales line to be able to create a sales order, the Cardinality would be OneMore (1…*).

RelatedCardinality specifies how many instances of SalesTable row can be related to a single instance of SalesLine row. ExactlyOne means that every sales line should belong to one and only one sales order.

Wednesday, August 7, 2013

Project and TimeSheet

From project --> Activity --> Scheduling and Resource Requirement, it allows skills to be added, and resources to be assigned.

At the project detail level, it also has scheduling and resource assignment fast tab.

Question is: how to bring in a resource to the project?