FormDataSource.init Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a data source query that is based on the data source properties.
public:
override void init();
public override void init ();
override this.init : unit -> unit
Public Overrides Sub init ()
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.
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);
}