Step 1 Create a Real Command Handler

VLF Windows Application Development

Step 1. Create a Real Command Handler

VFW042 – Snap in a Real Command Handler

In this step you will create a real command handler for the Details command.

1.  From the Framework menu, start the Program Coding Assistant.

2.  Select the iii HR Application / Employees / Details command handler.

3.  If necessary select Native MS Windows as the platform.

4.  Select Basic Command Handler as the type of code. This command handler, displays the fields you specify for the object selected in the instance list. It includes a Save button. You must complete the required update logic for this button.

     The CRUD Command Handler, is used with a CRUD filter. The commands defined for the business object must be New, Details, Copy and Delete.

     The Command Handler that maintains a list, generates a command handler for the business object data as well as providing a list of records from a related file.

5.  Click the Next button.

6.  Specify file name PSLMST as The physical file which most closely resembles this business object.

     As before the code assistant will select the key(s) of the file and the first two fields from the file, which are suitable in this case.

7.  Click the Next button.

8.  Specify file name PSLMST  in the Add fields from this physical file section.

9.  Click the Add All button.

10. Scroll down the list of fields. Select the following fields and use the Drop Selected button to remove them:

  • STARTDTER
  • TERMDATER
  • MNTHSAL

11. Click the Next button.

12. Select only the Include Default Save Button and Logic.

13. Click the Generate Code button.

     The generated code is displayed.

14. Specify iiiVFW06 as the name of the component and Employee Details Command Handler as the description.

15. Click the Create button.

16. After a few moments the Created in development environment message will be displayed.

17. Switch to the Visual LANSA editor.

18. Use the GoTo tab to find the SAVE_BUTTON click event routine.

     Add an UPDATE statement to update group_by fields XG_HEAD in the file PSLMST. Your code should look like the following:

     Update Fields(#XG_HEAD) In_File(pslmst) Val_Error(*next)

 

19. Compile your component.