Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

4.  Drag a push button into the second row.

     a.  Select the Layout ribbon and change Alignment to Top Left and Flow to Right.

     b.  Change margin Top to 20 and margin Left to 20.

     c.  Using the Detail tab, change the button Caption to Insert.

     d.  Change the Name to Insert.

     e.  Create a Click event for the Insert button.

5.  Create a Save method routine. This routine should have a similar structure to the Fetch routine:

     Define a component for the xDepartmentsDataServer Save srvroutine, named SaveDepartment

     Execute SaveDepartment asynchronously passing and receiving fields in Group_By xDepartments and IO$STS.

     Within an event routine for SaveDepartment.Completed, check If IO$STS is equal OK, and assign fields in Group_by xDepartments to their default value:

Your code should look like the following:

     Mthroutine Name(Save)
     Define_Com Class(#iiixDepartmentsDataServer.Save) Name(#SaveDepartment)
     #SaveDepartment.executeasync( #xDepartments #io$sts )
     Evtroutine Handling(#SaveDepartment.Completed)
     If (#IO$STS = OK)
     #xDepartments := *default
     Endif
     Endroutine
     Endroutine 

6.  Complete the Insert button click event by adding code to invoke the Save method.

     Evtroutine Handling(#INSERT.Click)
     #com_self.save
     Endroutine 

7.  Compile and Execute the web page. Enter a department code which doesn't exist such as 50 with any description and click Insert. Note that when successful, the Save routine clears the fields.

...