Hi,
I have an interface that contains a Grid based on a RecordType. So the latter can be filtered as need the users.
After being filtered, how may I get the datasubset of this RecordType ?
For example, on a 200 rows table, if the filtered RecordType displays only 5 rows, I need these 5 rows to be retrieved in my datasubset.
I need to work with this datasubset at anytime.
Discussion posts and replies are publicly visible
Please try to use the below-mentioned code and generate a grid based on the local!dataSubset. So, you will get the filtered (using a!queryfilter) data in the local variable and you can work on that variable.
Just curious - why do you need the datasubset of the data from the grid? Are you selecting this data for a form, or displaying something else on the interface, etc?
Thank you Paresh
Peter, my RecordType grid is in a sub interface. So yes, these data are needed by the parent interface to get the CDT list.After some actions these data are sent to the initial process model to update some data in DB.
Paresh,Maybe I missed something, but what you sent me works only if do not use this datasubset to populate my RecordType grid :local!datasubset : a!queryRecordType( recordType: recordType!R_MyContracts, pagingInfo: a!pagingInfo( startIndex: 1, batchSize:200 ) ),If I do this below, the datasubset result is decorelated of the recordtype of my grid:
a!gridField( label: "my contracts", labelPosition: "ABOVE", data: recordType!R_MyContracts,
If I do that, the datasubset is not accepted in my grid (Appian error):
a!gridField( label: "my contracts", labelPosition: "ABOVE", data: local!datasubset,
I guess my question is - can you use the options for selection to return the selected values to the parent interface? Usually it isn't as good a user experience to directly choose all the rows from the grid just based on the filters. I usually prefer having the user select the filters and then have them also select the rows they should use. If you use this paradigm, then you can just use the selection parameter in the grid to save into a variable that can be used in your parent interface.
Currently, yes, I use the selection IDs.Then in my parent interface, I use an expression rule to get the data, and get the rows data from the IDs selection (with the index() function).In place of using this expression rule, I would prefer to get the data directly from the RecordType.
Peter,I can not use the selection parameter as I need to use a Rule Input to store my selection objects.
This discussion below shows an error I met on Appian when I use a RI to store grid selection objects, maybe have you an idea to avoid this error? :-)
community.appian.com/.../77175
Can you set the rule input to be of type "Any Type" instead?
Good idea,Yes, it works fine, but then I have to use AnyType everywhere.If in my parent interface, I try to cast AnyType RI to my CDT RI it throws an error.I think it can do the job, but I would prefer to work with a CDT RI array over an AnyType RI array.Can you tell me where I can find the source code of the "difference" function... the error always happends in this function.