xpath constraint relation in reference set select page

0
My domain is currently like this :  Company 1- many Account. ( 1 company has many accounts, 1 account only belong to 1 company ) Project many – many Account ( 1 project may has many accounts, 1 account may take care of many project ) To select which Account is associate with which Project, I am using a Reference Set selector in Project_NewEdit page. In the select page, I use xpath to retrieve an account list with required roles. (account multiple select is requried) Now I want to add xpath to only show account that belong to same company as the project owner/creator. Is there anyway to do this via xpath?  I try using microflow instead of xpath but then the select button will become unavailable.
asked
1 answers
1

On the reference selector of your project_newedit page you can use xpath on the selectable objects: https://docs.mendix.com/refguide7/reference-set-selector#selectable-objects-properties

In order for the xpath to work, instead of using the default owner association i suggested creating a new association, something like: Project_Account_Owner, and set this association on the creation of the object.

Then you can use the following xpath:
[YourDomainModel.Company_Account/YourDomainModel.Company/YourDomainModel.Company_Account/Administration.Account/YourDomainModel.Project_Account_Owner = '[%CurrentObject%]']

Mind you, because you are using xpath on the reference selector the project should be committed in the database in order for it to work. 

answered