The Form or Table windows can include link buttons. These link buttons are used to display a table, a form or a table + form on linked files for example.
A simple example: viewing the orders of a customer from the form of the customer.
A link button must necessary be named:
- BTN_TableLink_RADFileX for a link to a table window
- BTN_FormLink_RADFileX for a link to a form window
- BTN_RelationLink_RADFileX for a link to a relation window.
Remark: BTN_ is the prefix of the code style: it is not required if no code style is used.
Any caption can be used. However, we recommend that you use a simple caption ("RADFileB table" or "RADFileA form" for example).
Code: Example of code that can be used in a link button, allowing you to open a table on the RADFileB file from the form on RADFileA:
// Implement the filter on the link key
HFilter(RADFileB,IDRADFileARel, RADFileA.IDRADFileA)
// Open the table window of RADFileB
Open(WIN_Table_RADFileB)
// Disable filter
HDeactivateFilter(RADFileB)
Position of the link buttons and additional link buttons
The link buttons can be positioned anywhere in the window. When generating the window, the link buttons will be created at the specified location. Depending on the size of the analysis used by RAD, more than 3 link buttons can be found in a window. Therefore, we recommend that you plan for additional link buttons.
These addition buttons are used to position the link buttons. Indeed, the link buttons can be aligned horizontally, vertically or even in circle.
The additional link buttons must have a specific name: BTN_LINK_n (BTN_ is the prefix in the code style: it is not necessary if you do not use a code style), where n is the number of the button (e.g., BTN_LINK_1). These buttons must contain no code and they must be associated with no preset action.
Remark: When performing the RAD generation, if the number of link buttons is greater than the number specified in the pattern, the additional generated buttons will be overlaid over the position of the last link button positioned in the pattern.