I have a Summary view interface with tabs at the bottom that each display another Read-Only Grid interface displaying info from related tables. I need to be able to have the information on those tabs to only show the records related to the parent record being viewed on the summary view. I know you can set filters at the Read-Only grid level on the individual interfaces, but at that point there is no parent record to reference so it returns an error. Does anyone have a way around this?
Discussion posts and replies are publicly visible
cls5469 said: but at that point there is no parent record to reference so it returns an error
Can you please clarify this statement ?
You must be having record identifier (rv!identifier) or specific record data (rv!record) as a rule input in the summary view interface which you can use to pass filter in the grids of related records
What do you mean with "but at that point there is no parent record"? Which point? Design time?
You can make that filter conditional using the applyWhen parameter.
You should have parent record to filter the data based on parent record,
If it is a child record try to get the parent id and pass it to the query rule to fetch the data and display the related data to the parent record.
Can you share the screenshots for better understanding
To answer the question you all asked, I meant at the point of designing the interface, there is no Parent record present. That statement may not make sense though. Regardless here is a screenshot of one of the listing interfaces. every time I try to set up a filter I get the error that the relationship path is null.
Can you share the snippet of filter you are trying to set up?
How would that parent record being passed? I assume via a rule input. So, why not just assign a value to that input?
This might provide more context also. This is the Summary Interface that the listing interfaces are being used. I need to filter the list showing in the tabs at the bottom of the interface to only show the child records associated with the parent record shown in the main part of the interface. Would that filtering be down at the List Interface level or somewhere on the summary interface? Note: we had to call interfaces into those tabs versus just adding read-only grids on the summary interface itself because we needed the added functionality of being able to select multiple records and delete multiple records, which as far as we know can't be done within the read-only grind component itself.
We got the whole context but were just requesting you to share what you have tried.
You need to pass on the primary record's primary key to each of the child tab interfaces and there you will be querying only those child records which are associated with the primary record in the data parameter of gridField().
For example in the queryfilter you pass something like,
a!queryFilter( field: recordType!PSLM document.field.matterId, /*related field for primary and child record*/ operator: "=", value: ri!matterId, /*from summary view interface*/ applyWhen: a!isNotNullOrEmpty(ri!matterId) )
I set up this record filter on the Document listing interface, where the field criteria is the primary key record as you mentioned. I believe it is working, for when I test the interface and put a 2 in the MainId input it returns 0 results because all the records are tied to MainId 1, but that is all I have in a way to test it for now. Is this not the same as what you did above? My expression mode does not show a section that looks like what you have, perhaps that is the difference? I appreciate your patience with this, I am still a novice with Appian but am under a deadline to figure this stuff out.
It is same as what I did above. In the expression mode, if you check the data parameter in gridField() you'll find the code for the same.
I believe now you have set it up just as you wanted, as you mentioned that there is only one row in main recordType so set the mainId to 1.
Do you have any other concerns which I'm missing here?