Add lookup

Hi,

I have a FormA “WarehouseRoute” this form has a control that is a display menu that opens a new FormB “No datasource in this last” this form contains a reference field “HcmWorkerRecId” HcmWorker the table, this field has in its properties FormHelp informed that opens a new FormC “This form displays a list of worker in more detail.”
So my goal and add a filter and display only the worker who have a connection with the WarehouseRoute from where you came from.
The relationship will be InventLocationId then how to pass the value of this variable from FormA to FormB and what type of lookup used. “please give me exemple code to use”.

Thank you

  1. Override the lookup() method of the form control.
  2. Create a new instance of HcmWorkerLookup class, typically by one of factory methods (with names prefixed by new), such as HcmWorkerLookup::newOnlyActiveWorkersWithinCompany().
  3. Get a Query instance by calling HcmWorkerLookup.updateQuery().
  4. Add your filter to the query.
  5. Call HcmWorkerLookup.lookupWorker(). Pass the form control as a parameter.

See lookupRegistrationWorker() method on JmgEmployee table as an example (or use cross-references to find more example).