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
Ok if you want to ensure the type matches, you should be able to set this up by adding the casting on the append as well as the difference. Also, make sure you use the list type to cast it correctly:
selectionSaveInto: { local!selection, a!save( ri!case, append( ri!case, cast( 'type!{urn:com:appian:types:PDL}PDL_Client?list', fv!selectedRows ) ) ), a!save( ri!case, difference( ri!case, cast( 'type!{urn:com:appian:types:PDL}PDL_Client?list', fv!deselectedRows ) ) ) }
Thanks a lot Peter, that works very well now.In all tests I've made, the only I did not think to do is to add "?list" when casting...Great ! :-)
Nice! There's also one other way to set it up if you need a list (if you're on 20.3 or later). There is a new function called a!listType() which will cast any type to a list without needing to add "?list" to the end.
selectionSaveInto: { local!selection, a!save( ri!case, append( ri!case, cast( a!listType('type!{urn:com:appian:types:PDL}PDL_Client'), fv!selectedRows ) ) ), a!save( ri!case, difference( ri!case, cast( a!listType('type!{urn:com:appian:types:PDL}PDL_Client'), fv!deselectedRows ) ) ) }
Thank you Peter, I keep this on hand :-)
As my initial question was "How to get data from a filtered RecordType", how would you get the number of records of this RecordType ?I do not have access to the subdataset.totalCount attribute.
local!data : a!recordData( recordType: recordType!R_MyContracts, filters: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: recordType!R_MyContracts.fields.status, operator: "=", value: "OK" ), }, ignoreFiltersWithEmptyValues: true ) ),