Retrieve a parent self referenced object

0
Hello,   When I retrieve by a self referencding association I can only retrieve one way, usually down the association (let's say the parent object retrieves all chlid objects). Is there any way to retrieve up the association, meaning retrieve the parent from the child?
asked
3 answers
2

Hey João,

You can add the reverse() function to Xpath. It is normally used after the association and is enclosed in [ ].

imagem.png

You can also see a video from the guy from the comment above (Mike Kumpf :D) where he explain how it works

https://youtu.be/5tznw5ZUQgk

 

Doc here:

https://docs.mendix.com/refguide/query-over/

 

You can also see:

https://community.mendix.com/link/space/academy/questions/128518

 

I hope it helps!

 

 

 

answered
1

Joao,

For this, you can use the reversed() operator in XPath.  Documentation can be found here: https://docs.mendix.com/refguide/query-over/

Hope that helps,

Mike

answered
0

Hi João Rafael,

 

 

To retrieve the parent from the child, you can just use reversed() in the xpath.

It will reverse the direction of retrieving/ reading the xpath condition.

 

To get a clear idea on all that context, you can go through this simple lecture

Reversed()

answered