The init() method is a standard method of a form data source, which is called when a form is opened after the implementation of the form init() method. This method helps create a data source query based on the data source properties.
Example
You have a custom form with a table named TrainingMaster. The table has an enum type field named TrainingType that has two values: Online and Classroom. The form should be opened with those records, where TrainingType is Online.
The code pattern should be as follows:
[DataSource] class TrainingMaster { public void init() { super(); this.query().dataSourceName("TrainingMaster") .addRange(fieldNum(TrainingMaster,TrainingType)) .value(enum2Str(TrainingType::Online)); } }
First read the answer fully, then try to explain it in your own words. After that, open a few related questions and compare the concepts. This method helps you remember the topic for a longer time and improves exam preparation.