Typical Search Code from a VLF-WIN Filter
* Indicate start of list update and set the framework to busy
Invoke Method(#avListManager.BeginListUpdate)
* Select employee records using full or partial surname in surname order and add to instance list
Select Fields(#EMPNO #GIVENAME #SURNAME #DEPTMENT #SECTION #ADDRESS1 #PHONEHME #POSTCODE) From_File(PSLMST2) With_Key(#SURNAME) Generic(*YES)
* add an entry to the instance list on the right of the filter
Invoke Method(#avListManager.AddtoList) Visualid1(#Empno) Visualid2(#FullName) Akey1(#Deptment) Akey2(#Section) Akey3(#Empno) Acolumn1(#Phonehme) Acolumn2(#Address1) Ncolumn1(#PostCode)
Endselect
* Indicate end of list update
Invoke Method(#avListManager.EndListUpdate)
Typical Search Code from a VLF-ONE Filter
You need both a client side program and a server side program.
Client Side (a Reusable Part, Target Platform Web - See Example DF_T41F1O).It makes the call to the server module, receives the data back as a list, and writes the data from the list to the instance list:
* Define the Server Module method routine used to get employee data from the server
Define_Com Class(#DF_T42DSO.FindPSLMST2) Name(#Find)
* Ask Server Module DF_T42DSO to get the data from the server
#Find.ExecuteAsync( #SearchSurname #GIVENAME #PSLMSTList )
* The call is asynchronous so we have an event that occurs when the call is finished
Evtroutine Handling(#Find.Completed)
* Read the list returned by Server Module DF_T42DSO
Selectlist Named(#PSLMSTList)
* Add the details to the instance list
#avListManager.AddtoList Visualid1(#EMPNO) Visualid2(#SURNAME + ' ' + #GIVENAME) Akey1(#EMPNO)
Endselect
Endroutine
Server Side Program (a Server Module - See Example DF_T42DSO)
It does the database IO and passes the data back to the client program, as a list:
Srvroutine Name(FindPSLMST2) Session(*REQUIRED)
Field_Map For(*Input) Field(#SURNAME)
Field_Map For(*Input) Field(#GIVENAME)
List_Map For(*Output) List(#PSLMSTList)
Field_Map For(*Output) Field(#io$sts)
* Get all records from the file using some or all of the key
Select Fields(#PSLMSTList) From_File(PSLMST2) With_Key(#SURNAME #GIVENAME) Nbr_Keys(*Compute) Generic(*Yes) Io_Error(*Next)
Add_Entry To_List(#PSLMSTList)
Endselect
Endroutine