Mendix XPath Error: Filtering Items by Location Country (Line 1, Col 79)

0
Hi All, On my Mendix app's 'Locations' page, I need to implement buttons for specific countries (e.g., USA, Canada) that, when clicked, display a list of all items associated with locations within that chosen country. However, the X-Path I am trying to implement is giving me an error. Can someone help me? Thanks in advance.   Domain Model:   X_Path Error:
asked
4 answers
5

Looks getting error due to incorrect association path. 

Please try with similar given below. 

 

[Item_Stock_Location/Stock_Location/Country = $SelectedCountry]

 

[Item_Location/Location/Location_Stock_Location/Stock_Location/Country = $SelectedCountry]

 

 [Item_Stock/Stock/Stock_Stock_Location/Stock_Location/Country = $SelectedCountry]

answered
0

Hello,

 

 Country attribute is an enumeration, so it must be compared with an enumeration of same type not with the path. The first part of your expression is fine change the second part to $Selected_Country_Filter/Country (I am assuming you have this $Selected_Country_Filter this object on the page) or $currentObject/Country.

 

Hope this helps!

 

Thanks & Regards,

Amit Gupta

answered
0

Hi,

If you're adding a separate button for each country, you can retrieve the corresponding Location from the database using xpath [Country=$Parameter] or [Country='USA']  and then fetch the related Items through the association.

image.png

answered
0

Hi ,

 

As i understand your error statement,

Try as below,

image.png

 

Either hardcode the country value as per the Enumeration value or try to create Enum in the microflow use it.

Hope this helps.

If not please help me with some page screenshots those can helps to understand better.

 

Satya Reddy

answered