FormDataSource.init Method

Creates a data source query that is based on the data source properties.

Syntax

public void init()

Run On

Client

Remarks

This method is called when the form is opened. The query that is generated by the method is used to the load data so that it can be displayed in the form.

The init method can be overridden on a form data source. Right-click the Methods node under the data source, point to Override Method, and then click init.

Examples

The following example overrides the init method on a data source to specify the sorting order for the data source.

public void init() 
{ 
    super(); 
    this.query().dataSourceTable( 
        tablenum(SysVersionControlTmpItem)).addSortField( 
            fieldnum(SysVersionControlTmpItem, VCSDate), 
        SortOrder::Descending); 
    this.query().dataSourceTable( 
        tablenum(SysVersionControlTmpItem)).addSortField( 
            fieldnum(SysVersionControlTmpItem, VCSTime), 
        SortOrder::Descending); 
    this.query().dataSourceTable( 
        tablenum(SysVersionControlTmpItem)).addSortField( 
            fieldnum(SysVersionControlTmpItem, ChangeNumber), 
        SortOrder::Ascending); 
}

See Also

FormDataSource Class

FormDataSource.executeQuery Method

FormDataSource.research Method

FormDataSource.prompt Method