[ |../../index.htm#lansa/wbfeng01_0215.htm]
You are here:

Step 3. Fetch Existing Data from a Table

In this step you will execute the Find srvroutine in the Department Server Module, which uses the FETCH command to retrieve a single record from the database. If you examine the code generated for the xDepartments Server Module, you will notice that there are no OPEN or CLOSE statements required for the table. Table opening and closing is handled automatically by LANSA.
1.  Switch to the server module iiixDepartmentsDataServer in the editor and locate the Find srvroutine.
     Hint: Use the Go To tab.
Srvroutine Name(Find)
Field_Map For(*Input) Field(#xDepartmentCode)
Group_Map For(*Output) Group(#xDepartments)
Field_Map For(*Output) Field(#io$sts) Parameter_Name(Status)
 

6.  Invoke the Fetch method from the Fetch button Click event:
Evtroutine Handling(#Fetch.Click)
#com_self.Fetch
Endroutine
 
7.  Compile your web page. Execute the web page in the browser. Department code is a 4 long, Alphanumeric field, containing a number code. Enter a department code such as 100, 200, 1000 or 1100 and click the Fetch button. The department description should be displayed.

[ |../../index.htm#lansa/wbfeng01_0215.htm]