Creating an employee list

This shows how to create an employee list application. The employee list shows total sales figures for each sales representatives using information in sampledb.

StepsCreating the employee list of sales reps

  1. In Mobile Web Studio, select Applications in the left pane, New in the Application Builder Status menu, and click the New button.

  2. In Application Builder, click the down arrow to the right of Add, and select Database Element.

  3. On the Database Element Definition window, define the database element:

    1. Select the Connection Cache option.

    2. In Conn Cache Name, select sampledb from the drop-down list.

    3. In SQL query string, enter this query:

      set rowcount 10
      select e.emp_id, e.emp_fname, e.emp_lname,
      s.cust_id,  (soi.quantity * p.unit_price) as
      sales_total from employee e, sales_order s,
      sales_order_items soi, product p where e.emp_id
      = s.sales_rep and s.id = soi.id and soi.prod_id
      = p.id and s.region = '@OP["region"="Western"]'
      set rowcount 0
      
    4. Click Preview and make sure these columns are included: emp_id, emp_fname, emp_lname, cust_id, and sales_total.

      Figure 4-2: Preview for EmployeeSales

  4. Click Next. The Define window displays.

  5. On the Define window, select “Records Contain Labels,” in “Labels are Displayed in Record” accept the default 1.

  6. Click Next. The Filter window displays.

  7. Click Next. The Configure Parameters window displays.

  8. On the Configure Parameters window, make these modifications (otherwise accept the defaults):

  9. Click Next. The Window Preview displays.

  10. In Element Name, enter employeeSales, and click Finish.

  11. In Application Builder, click Save to create the application.

  12. On the Finish window, make these changes (otherwise accept the defaults):

    Content tab Select 15 minutes for the Content Cache Interval. The Content Cache Interval determines how frequently the UA server retrieves data from the back-end system (in this case the sampledb database).

    Mobile tab Select “Make Available to Offline Devices,” then click Finish.

  13. Click OK to confirm.

  14. Click Close to close Application Builder.

  15. When you return to the Mobile Web Studio main window, select New from the Application Builder Status menu. The employeeSales application displays in the detail pane.

  16. In Mobile Web Studio, right-click the employeeSales application in the detail pane, and select Approval Status | Approved.

    Click OK to confirm.

  17. Select Approved from the Application Manager Status menu. You see your newly approved employeeSales application in the detail pane.