Why am I not able to use two Constraints that reference the same %currentObject%?

0
Hi Team, I have an "Account" object with two associations to a "Box" object. Both Asscociations are (1) Account to (*many) Boxes I also have a "Ticket" as a caller of a page. Within my Ticket view I have a Reference Set Selector which view 'Boxes'associated to the ticket. (1) Account is associated to (many) tickets and (many) Tickets are associated to (many) boxes using the ticket as my %currentObject% from a dataview I want to constrain+combine the boxes Associated to the Account so that I can select multiple boxes and associate those 'Boxes' selected, to the 'Ticket' which the 'Account' is associated to Without out needing to add a third association with the contents of the other 2 associations combined. Essentially what I'm asking is: Why am I not able to use two Constraints that reference the same %currentObject%? e.g: With xPath set as [ CRM.Box_Account/CRM.Account/Ticketing.Ticket_Account/Ticketing.Ticket/id = '[%CurrentObject%]' or CRM.Box_Account_SharedBoxes/CRM.Account/Ticketing.Ticket_Account/Ticketing.Ticket/id = '[%CurrentObject%]' ] no data shows in the selector page and with just [ CRM.Box_Account_SharedBoxes/CRM.Account/Ticketing.Ticket_Account/Ticketing.Ticket/id = '[%CurrentObject%]' ] Only one or the other xPath constraint will work.
asked
2 answers
4

Hi Courtney,

This is an issue in Mendix which was fixed with the 7.14.1 release - check the relase notes - https://docs.mendix.com/releasenotes/desktop-modeler/7.14

When the XPath constraint of a reference selector, reference set selector, or input reference set selector contained more than one occurrence of '[%CurrentObject%]', they were not resolved correctly, leading to no objects being found. All occurrences of '[%CurrentObject%]' are now resolved correctly. (Ticket 62713)

I dont think there is much you can do apart from upgrading.

-Andrej

answered
0

There is no reason this would not work: I use this construction regularly. The most logical explanation is that there is either a data issue, or a security issue (e.g. Entity Access which is too tight).

 

I would suggest debugging by creating a microflow which retrieves every object in both paths, and then intersect the resulting lists. Then, place a breakpoint in the microflow, so you can inspect the results. If you have data after the intersect, you have a data security issue. If one of the lists is empty, you have a data issue.

answered