See the documentation here: https://docs.mendix.com/refguide/xpath-not/
To check the objects with no reference you can do something like this:
[not(Sales.Customer_Order/Sales.Order)]
And thus to retrieve all the objects that do have a reference you can use this:
[Sales.Customer_Order/Sales.Order]
Regards,
Ronald
Thanks, Ronald!