Skip to main content

11 - Add an Action Page

Last updated 16/12/2025

This documentation will explain how you can add a page on a form that references another action besides a form. The recommended actions are:

We are going to add a data view that will display the shares we have sold. This data view will then become a page on the Buys form, so we can see what shares we have sold without having to leave a buy record.

The SellAllocations query needs to be added which will return the allocation records linked to the sell records, along with the transaction date, allocation quantity, sell quantity, and the buyKey for a specific buy.

Add the SellAllocations Query

1. Click Data in the menu followed by Queries in the sub-menu.


Queries menu item
Figure 1 - Queries menu item

2. Click the Add Item button and type SellAllocations in the Data Source ID field.

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


Add SellAllocations query
Figure 2 - Add SellAllocations query

4. Click the SQL tab.


SQL tab
Figure 3 - SQL tab

5. Click the Copy button for the syntax below.

MySQL
SellAllocations
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 button
Figure 4 - Save button

8. Click the Fields tab.


Fields tab
Figure 5 - Fields tab

9. Select the TransactionDate record.


TransactionDate record
Figure 6 - TransactionDate record

10. Edit the following fields:
  • Select Date in the Data Type field
  • Type 8 in the Size field
  • Add a space between Transaction and Date in the Default Caption field
  • Select _Date in the Default Display Type field

Edit TransactionDate field
Figure 7 - Edit TransactionDate field

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


Save button
Figure 8 - Save button

12. Select the Quantity record.


Quantity record
Figure 9 - Quantity record

13. Edit the following fields:
  • Select Integer in the Data Type field
  • Type 4 in the Size field
  • Select _Integer in the Default Display Type field

Edit Quantity field
Figure 10 - Edit Quantity record

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


Save button
Figure 11 - Save button

15. Select the SellQuantity record.


SellQuantity record
Figure 12 - SellQuantity record

16. Edit the following fields:
  • Select Integer in the Data Type field
  • Type 4 in the Size field
  • Add a space between Sell and Quantity in the Default Caption field
  • Select _Integer in the Default Display Type field

Edit SellQuantity record
Figure 13 - Edit SellQuantity record

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


Save button
Figure 14 - Save button

18. Click the Parameters tab.


Parameters tab
Figure 15 - Parameters tab

19. Click the Add Parameters button.


Add Parameters button
Figure 16 - Add Parameters button

20. Type BuyKey in the Parameter ID field.

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



Add BuyKey parameter
Figure 17 - Add BuyKey parameter

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


Save button
Figure 18 - Save button

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


Save button
Figure 19 - Save button

Add the Sell Allocations Data View

The Sell Allocations data view needs to be created using the SellAllocations query to display the results.

1. Click Visual in the menu followed by Data Views in the sub-menu.


Data Views menu item
Figure 20 - Data Views menu item

2. Click the Add Item button and type Sell Allocations in the Title field.

3. Select SellAllocations (Query) in the Data Source field.


Add Sell Allocations Data View
Figure 21 - Add Sell Allocations data view

4. Click the Data Fields tab.


Data Fields tab
Figure 22 - Data Fields tab

5. Select the TransactionDate record.


Transaction Date record
Figure 23 - Transaction Date record

6. Click the Cancel button in the Width field and type 20.


Edit Transaction Date field
Figure 24 - Edit Transaction Date field

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


Save button
Figure 25 - Save button

8. Repeat the same steps in the Width field for the Quantity and SellQuantity records.

9. Select the BuyKey record.


BuyKey record
Figure 26 - BuyKey record

10. Type
false
in the Show If field.



Edit BuyKey record
Figure 27 - Edit BuyKey record

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


Save button
Figure 28 - Save button

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


Save button
Figure 29 - Save button

Add the Sell Allocations Page

The Buys form needs to be edited to add the Sell Allocations data view as an action page.

1. Click Visual in the menu followed by Forms in the sub-menu.


Forms menu item
Figure 30 - Forms menu item

2. Select the Buys record in the list and click the Pages tab.


Pages tab
Figure 31 - Pages tab

3. Click the Add Pages button.


Add Pages button
Figure 32 - Add Pages button

4. Type Sell Allocations in the Caption field, select Action in the Page Type field, and select SellAllocations (Data View) in the Action field.


Add Sell Allocations page
Figure 33 - Add Sell Allocations page

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


Save button
Figure 34 - Save button

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


Save button
Figure 35 - Save button

tip
This is a good time to deploy/run the Portfolio application and see the Sell Allocations page on the Buys form!

Test the Buys Page

1. Select the Growth Portfolio record in the list and click the Down button in the form app bar.


Down button
Figure 36 - Down button

2. Select Buys in the menu.

3. Select either of the TSLA records and click the Sell Allocations tab.


Sell Allocations tab
Figure 37 - Sell Allocations tab

info
We can see the amount of shares that were allocated for the sale.

Sell Allocations page
Figure 38 - Sell Allocations page

4. Close the browser tab.