I have two record types:
1. Asset
2. Match Report
The Assets have a one-to-many relation with the Match Report
I want to show an Asset specific grid where it shows all the Match Reports of that Asset
I have created a read-only-grid where I query that the assetId should match the match_report.asset.assetId
This only works if the Asset has a minimum of one Match Report created
If there are no match reports available linked to the asset, the query will fetch all match reports from all assets and show them in the grid.
Can someone help me to make sure the grid is empty if there are no match reports available?
This is my query in expression:
a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "asset.assetId", operator: "=", value: ri!AM_Match_Report.asset.assetId ) }, ignoreFiltersWithEmptyValues: true )
Discussion posts and replies are publicly visible
It looks lilke "ignoreFiltersWithEmptyValues: true" is causiing the query to return all "Match Reports". What variable are you storing the selected assetId in from the Asset Grid?
Can we see more code?
Hi Bryant, I have tried setting "ignoreFiltersWithEmptyValues" to false. This is the error I am getting:
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!gridField [line 2]: Expression evaluation error at function a!queryLogicalExpression [line 34]: The a!queryFilter function has an invalid value for the “value” parameter. When the value of “operator” is “=” “value” must not be null or empty.
The selected assetId is coming from the Asset that the user has selected to view the match reports on
How are you saving the selected asset id in the Asset grid?
I am not sure if i get your quetsion. Via rule input? The interface opens on another page of the record type
It still seems like the query is ignoring the filter, which means it will return all entries in the DB. Which means in that case you do not want the query to run at all.