To create a lookup form by adding a new form in the AOT, simply create a
form the way you would like to have your lookup form look like and then set
the WindowType property to Popup on the Design node. Before super() in
the run method (or after super() in the init method) of the form; you use the
selectMode() method to set the field that should return a value to the form that
opened the lookup form.
In the form where you want to use this new specialized lookup you will have to
change the lookup method on the lookup field in the Data Source.
We will create a lookup form like this for the CarTable so that the lookup can sort by
the mileage when the user is in the RentalTable form.
First, we create the new form in the AOT and call it CarIdLookup. We add the
CarTable in the data sources and add a piece of code in the init method of the data
source to make sure that the form will sort by mileage