Hidden Filter

Visual LANSA Framework

Hidden Filter

In situations where you want to completely fill the business object instance list programmatically, the filter has no meaningful interaction with the end-user and can be hidden from view.

Here is an example of a hidden filter that selects all the employees in an HR system and adds them to the instance list:

Notice that the filter is not visible. This filter has a uInitialize routine like this:

 

Mthroutine Name(uInitialize) Options(*Redefine)

* Do the ancestor  thing ....

Invoke #Com_Ancestor.uInitialize

* Define this as a hidden filter ( you can only ever sensibly have a 
* single filter when it's hidden )

Set #Com_Owner avHiddenFilter(TRUE)

* Now fill the instance list with all employee details 

Invoke #avListManager.BeginListUpdate

Invoke #avListManager.ClearList

Select Fields(#EmpNo #SurName #GiveName) From_File(PSLMST) 
Use BConcat (#GiveName #SurName) #Std_TextL
Invoke Method(#avListManager.AddtoList) Visualid1(#Empno) Visualid2(#Std_TextL)     Akey1(#Empno)
EndSelect

Invoke #avListManager.EndListUpdate

* Finished

EndRoutine