In Designer mode
Let us add the prices to the list of materials and services.
- In Designer, open the list form of the MaterialsAndServices catalog.
- Open the property palette of the main List attribute.
Up to this point the Main table property of the dynamic list was set to Catalog.MaterialsAndServices (see fig. 27.10) and the list was generated using a query to the table.
Now you also need the related data from the Prices.SliceLast information register table.
- Select the CustomQuery check box and then, in the List setup field, click Open (fig. 27.16).
Fig. 27.16. Opening dynamic list settings
This opens the dynamic list settings window. On the Query tab you can see the query that selects all the fields from the Catalog.MaterialsAndServices table. Let us modify it.
- Click the Query Builder button (fig. 27.17).
Fig. 27.17. Creating a custom query for a dynamic list
- Add Prices.SliceLast to the list of tables and select the Price field from this table (fig. 27.18).
Fig. 27.18. Adding a second table
Let us edit the automatically generated relation between the tables.
- On the Links tab, select the All check box for the Catalog.MaterialsAndServices table and clear the All check box for the Prices.SliceLast table (fig. 27.19).
Fig. 27.19. Specifying the relation between the tables
This is how you specify that the list of materials and services displays all the items, including those that have no prices assigned. You performed similar steps in lesson 13 "Reports" for the Service list report.
This completes the query creation.
- Click OK.
You are already familiar with the query script so we will not discuss it here.
So you added the option to display the Price column, which contains the current prices, in the list of materials and services, but the column is not yet added to the list form.
Now let us specify the conditional appearance of the Price column by highlighting low prices with a color.
- In the dynamic list settings window, click the Settings tab.
- Click the Conditional appearance tab.
This tab contains the conditional appearance of the list rows that you created earlier in this lesson.
- Click the Add button.
First, let us specify the formatting for highlighting fields.
- In the Format field, click the selection button and select blue text color.
Then let us specify the condition for the appearance to be applied (when the text in the Price column should be blue).
- In the Condition field, click the selection button .
- In the window that is opened, click the Add button and then click New item.
- In the Left value column, select Price.
- In the Comparison type column, select Less than.
- In the Right value column, enter 500 (fig. 27.20).
Finally, let us specify the fields where the formatting is applied.
- In the Formatted fields column, click the selection button .
- Click Add and select Price (fig. 27.20).
Fig. 27.20. Dynamic list conditional formatting settings
- Click OK.
- Drag the Price field from the attributes pane to the controls pane (fig. 27.21).
Fig. 27.21. Adding a column to the list form
Now let us specify individual properties for each conditional appearance settings item.
- In the dynamic list settings window, on the Settings tab, click the first settings item and then click the Custom settings item properties button.
- Select the Include in custom settings check box, set Presentation to Services, and in the Edit mode field, leave the Quick access value.
- Click OK.
- For the second settings item, select the Include in custom settings check box, set Presentation to Low price, and in the Edit mode field, leave the Quick access value.
- At the bottom of the tab, set the general Editing mode property to Normal (fig. 27.22).
Fig. 27.22. Conditional appearance settings item properties