Exercise - Migrated Style Parameters

  1. Create a new UIController name it ShowCustomers.
  2. Set the Customers Entity as the main table.
  3. Add 2 local columns:
    1. type NumberColumn name NumberOfOrders.
    2. type NumberColumn name TotalFreight.
  4. Add these columns to the form (Do not use a grid):
    1. From Customers
      1. CustomerID.
      2. CompanyName.
      3. ContactName.
    2. Local column NumberOfOrders.
    3. Local column TotalFreight.
  5. Add a new menu entry and call ShowCustomers.
  6. Save changes to Git.
  7. Build and test.
  8. Add a new BusinessProcess name it CalcTotalOrdersPerCustomer.
  9. Set the Orders Entity as the main table.
  10. Add 3 local columns:
    1. type TextColumn name CustomerID.
    2. type NumberColumn name NumberOfOrders.
    3. type NumberColumn name TotalFreight.
  11. Add Where after the From, to show only records equal to the CustomerID local column.
  12. In the Run method receive 3 Parameters and do:
    1. TextParameter name pCustomerID use the BindParameter method to connect the parameter and the local column CustomerID.
    2. NumberColumn name pNumberOfOrders.
    3. NumberParameter name pTotalFreight use the BindParameter method to connect the parameter and the local column TotalFreight.
    4. After the call to Execute, update the pNumberOfOrders value with the local column NumberOfOrders value.
  13. Override the OnLeaveRow.
  14. set NumberOfOrders value to increase by 1 for every row.
  15. set TotalFreight value to accumulate the value of Freight column from the Orders table.
  16. Save changes to Git.
  17. Build and test the BusinessProcess using the ShiftF3 send ANATR and check the Output panel for the results.
  18. In ShowCustomers add a button to the screen, set the button text to Get Total Orders.
  19. set the value of NumberOfOrders and TotalFreight to zero.
    This should be done before the call to CalcTotalOrdersPerCustomer
  20. Call the CalcTotalOrdersPerCustomer from the button click event and send the parameters.
  21. Save changes to Git.
  22. Build and test, notice that NumberOfOrders and TotalFreight are update with values when clicking the button.
  23. In ShowCustomers view, find the call to CalcTotalOrdersPerCustomer.
  24. Try to change the second parameters NumberOfOrders and send its Value, notice the error.
  25. Cancel the last item change and try to do the same for TotalFreight notice that you will not get an error.
  26. Save changes to Git.
  27. Build and test, notice that TotalFreight is not update when you click the button.

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com