I am trying to reference to a text within a group within a collection as follows. Is that possible?
'Customers': collection ['Relation']
'Relation': text
'Invoicing': group @breakout {
'Currency': text ~> ^ ^ .'Relationship Management'.'Currencies'[]
'Orders': collection ['Sales Nr.']
....
'Customer': text -> ^ ^ .'Customers'[] @identifying
'Currency': text ~> <- >'Customer'>'Invoicing'.'Currency'
Hi Martinique,
There is a reference and there is a derivation. They generally look like this:
'property': text -> >'path'.'to'.'collection'[] = >'derivation'. 'to'>'reference'
or
'property: text ~> <- >'path'.'to'.'collection'[] = >'derivation'.'to'.'text'
So, the first part describes what you reference and the second part (after the = sign) is how you derive that (if you derive it). Note that the ‘to’ in these paths is a group, so that answers part of your question: a group is simply selected by the . (and the > is only used in case of references)
You seem to want to copy the value of ‘Currency’ to the location where you already have a reference to a Customer. There are several options to do that:
- make currency @identifying on the customer, it will show up everywhere a customer is referenced
- add the following @show: statement after the Customer reference (does the same as above, but only on that location):
@show: (
'Invoicing' (
'Currency'
)
)
- Derive the Currency value on the spot (it gets recreated on the server that way)
if you only want the text value:
'Currency': text = >'Customer'.'Invoicing'.'Currency'
If you need the link to the Currency entry as well. It cannot be a hard reference in this case, as the source is not a hard reference either:
'Currency': text ~> ^ . 'Relationship Management'.'Currencies'[] = >'Customer'.'Invoicing'.'Currency'
2 Likes