Programming Microsoft Dynamics NAV(Fifth Edition)
上QQ阅读APP看书,第一时间看更新

Assigning a table relation property

Finally, we open the Radio Show table again by highlighting the table line and clicking on the Design button. This time highlight the Type field and access its Properties screen. Highlight the TableRelation property and click on the ellipsis button (the three dots). We see the Table Relation screen with four columns as shown in the following image. The middle two columns are headed Table and Field. In the top line in the Table column, enter 50001 (the table number) or Radio Show Type (the table name). In the same line, the Field column, click on the up arrow button and choose Code:

We exit the Table Relation screen (by clicking the OK button) and return to the Type - Properties page that looks like following image. Save and exit the modified table:

To check that the TableRelation is working properly, we could run the Radio Show table (that is, highlight the table name and click on the Run button). We could also run the Radio Show List page and have almost exactly the same view of the data. This is because the Run of a table creates a temporary list page that includes all the fields in the table, thus it contains the same data fields as the page we created using the page wizard. In either one, we should highlight the Radio Show Type field and click on the drop-down arrow to view the list of available entries. The following screenshot is of our Radio Show List page; you should also try it using the Run function on the Radio Show table:

If all has gone according to plan, the Radio Show Type field will display a drop-down arrow (the downward pointing arrowhead button). Whether we click on that button or press F4, we will invoke the drop-down list for the Radio Show Type table as shown in the preceding screenshot.