Object references are used to establish relationships between objects.
If you create an object and below this object another object, as we have already done in our tutorial (product (e.g. sigma) and material (e.g. connection cable),then you can use the connection cable from the start object via the point notation:
Product:"Sigma".[Connection Cable]
For example, if you want to determine the price of the connection cable, you can use the following (error tolerant) code:
If Product IsA ::Sigma Then
MsgBox(Product:Sigma.[Connection Cable].Price)
End If
But what is the way when an element from the product, e.g. the country version, is to be queried from the connection cable? The object reference that finds the next parent of a particular class type, helps.
In the Material class, define:
Then, access to Products returns the nearest parent object of class type Products (it’s the definition class of the object reference), if there is an object of this type, or NoValue, if there is none. It is irrelevant in which parent level this object exists. The first object that meets this condition returns this object.
For example, this object reference could be used to write the following decision in a particular material:
The decision is performed only if the parent object is of class type Sigma and the country execution of product meets certain criteria.
(knowledge base Tutorial Stage 7)