If you want to output the material that was indirectly selected in the configuration in tabular, you can use the Table control from TCE.
How do we achieve this goal?
We want to output five columns for the material list:
ID |
The ID is the class name of a material object |
Number |
So far, no feature has been created for the number of material objects We therefore create a feature of type Long in the Material class and initialize it with a value of 1 |
Description |
The multilingual description of the class of a material object |
Price |
The Price feature of a material object |
Position price |
So far, no feature has been created for the line price. The formula for this feature is: position price = number * price |
Creating a feature for the number of each material
Creating a feature for the position price of each material; the feature gets it’s value via the Get event
Now it’s time to create the window for displaying the material objects.
Use the knowledge base properties to select the TCE table controls:
Now create another form, for example, with the name Material in the Start class.
Now create a table control with the name [Material table] on this form.
The control is a base control for table columns. Add table columns to the table control.
The properties of the table control are now set to display the table rows. We want to display all objects of type Material, beginning with the object Product.
Class |
::Material We want to show all objects in the table of the class type Material |
Recurse |
True We want to make a deep search into all objects |
Value |
The start object of the search is Product |
Now you have to set the properties of each table column. The first column should output in each row the ID of the material. In our case, the ID is the class name of the object.
Class |
::Material The expression for value is retrieved from an object of the Material class |
Value |
Me.ObjectClass.Name Getting the name with the attribute function ObjectClass |
The second column is intended to output the number of each Material object:
Class |
::Material |
Value |
NumberOf |
The third column is intended to output the multilingual description of each Material object:
Class |
::Material |
Value |
Me.ObjectDescription |
The fourth column is intended to output the price of each Material object:
Class |
::Material |
Value |
Price |
The fifth column is intended to output the position price of each Material object:
Class |
::Material |
Value |
[Position price] |
Now all table columns are defined.
Finally, the Material form must be displayed. To do this, create a new menu item in the main menu and call up the form in the Click Event.
Material.Show
(knowledge base Tutorial Stage 6)