Skip to main content

11 - Add an Action Page

Last updated 5/04/2023

This documentation is to demonstrate how you can create an action page on a form. Five has the following actions:

  • Forms
  • Charts
  • Queries
  • Dashboards
  • Mail Merges
  • Processes

We are going to add a query that will return stocks that we have allocated for a sale. This query will then be referenced on the Buys form so we can have a report for the stock that has been sold without having to leave the Buys form.

1. Select Visual in the menu.

2. Select Queries in the sub-menu.


Queries Menu Item
Figure 1 - Queries menu item


Add the Sell Allocations Query

1. Click the Add Item button.

2. Type Sell Allocations in the Title field.

3. Click in the Query field to open Five's Query Builder.


Add the Sell Allocations Query
Figure 2 - Add the Sell Allocations query


4. Click the SQL tab.


SQL Tab
Figure 3 - SQL tab


5. Click the Copy button for the below syntax.


Investment by Sector
SELECT
TransactionDate,
Allocation.Quantity AS Quantity,
Sell.Quantity AS SellQuantity,
Allocation.BuyKey AS BuyKey
FROM
Allocation
INNER JOIN Sell ON Allocation.SellKey = Sell.SellKey
HAVING
(BuyKey = ?)
ORDER BY
TransactionDate



6. Paste the syntax in the SQL Editor.

7. Click the Save button in the SQL Editor app bar.


Save the Sell Allocations Syntax
Figure 4 - Save the Sell Allocations syntax


8. Click the Fields tab.


Fields Tab
Figure 5 - Fields tab


9. Select the TransactionDate record.


TransactionDate Record
Figure 6 - TransactionDate record


10. Click in the Caption field and add a space between Transaction and Date.

11. Click the lookup icon in the Display Type field and select _Date.

12. Click the Save button in the form app bar.


Edit the TransactionDate Record
Figure 7 - Edit the TransactionDate record


13. Select the Quantity record.


Quantity Record
Figure 8 - Quantity record


14. Click the lookup icon in the Display Type field and select _Integer.

15. Click the Save button in the form app bar.


Edit the Quantity Record
Figure 9 - Edit the Quantity record


16. Select the SellQuantity record.


SellQuantity Record
Figure 10 - SellQuantity record


17. Click in the Caption field and add a space between Sell and Quantity.

18. Click the lookup icon in the Display Type field and select _Integer.

19. Click the Save button in the form app bar.


Edit the SellQuantity Record
Figure 11 - Edit the SellQuantity record


20. Select the BuyKey record.


BuyKey Record
Figure 12 - BuyKey record


21. Type false in the Show If field.

22. Click the Save button in the form app bar.


Edit the BuyKey Record
Figure 13 - Edit the BuyKey record


23. Click the Parameters tab.


Parameters Tab
Figure 14 - Parameters tab


24. Click the Add Parameters button.


Add Parameters Button
Figure 15 - Add Parameters button


25. Type BuyKey in the Parameter ID field.

26. Type {{five.stack.Buy.BuyKey}} in the Parameter field.


Add the BuyKey Parameter
Figure 16 - Add the BuyKey parameter


27. Click the Save button in the form app bar.


Save the BuyKey Parameter
Figure 17 - Save the BuyKey parameter


28. Click the Save button in the form app bar above the list.


Save the Sell Allocations Query
Figure 18 - Save the Sell Allocations query


Create the Sell Allocations Page on the Buys Form

1. Select Visual in the menu.

2. Select Forms in the menu.


Forms Menu Item
Figure 19 - Forms menu item


3. Select the Buys record in the list.

4. Click the Pages tab.


Pages Tab
Figure 20 - Pages tab


5. Click the Add Pages button.


Add Pages Button
Figure 21 - Add Pages button


6. Type Sell Allocations in the Caption field.

7. Click the lookup icon in the Page Type field and select Action.

8. Click the lookup icon in the Action field and select SellAllocations (Query).


Add the Sell Allocations Page
Figure 22 - Add the Sell Allocations page


9. Click the Save button in the form app bar.


Save the Sell Allocations Page
Figure 23 - Save the Sell Allocations page


10. Click the Save button in the form app bar above the list.


Save the Buys Form
Figure 24 - Save the Buys form


Run the Portfolio Application

1. Click the Run button in Five's toolbar.


Run Button
Figure 25 - Run button


2. Select the Growth Portfolio record.

3. Click the Down button in the form app bar.


Down Button
Figure 26 - Down button


Test the Buys Form

1. Select Buys in the menu.

2. Select the first AEI record in the list.

3. Click the Sell Allocations tab.


Sell Allocations Tab
Figure 27 - Sell Allocations tab


info
We can see 1100 AEI shares were sold and 1000 of them came from this purchase date.



Sell Allocations Page
Figure 28 - Sell Allocations page


4. Close the browser tab.