Hello, I have an interface which displays the data from the record type directly on a read-only grid, where users can select one or multiple rows and perform certain actions (not record actions). The issue users have reported is, that if they are on page 10 when they perform an action (let's say delete a row), it brings them back to page 1 each time and they have to navigate to the desired page all over again to continue. Additionally, if they also applied a sort of any kind to one of the rows, that also resets.Is there a way to make it so that users remain on the page they navigated to using the pagingSaveInto? I have tried multiple ways but nothing worked, the grid is always refreshed to page 1 after an action. Thank you!
a!columnsLayout( columns: { a!columnLayout( contents: { a!gridField( label: "Failed File Emails", data: a!recordData( recordType: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails', fields: { 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{aec8292a-2488-4c54-ac69-c911df3a1056}emailBody', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{6ecb31a1-3938-42ce-8216-d21c282fea1b}emailDate', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{611abf1e-fdce-4140-9a63-e8e7a62d0d0a}emailErrorMessage', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{270468e8-43ba-4161-9759-f6113cd3f821}emailSubject', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{c83a9af9-bf52-48cd-9aac-beb41183db38}fileName', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{d12cf7a6-51ef-4554-9d3b-16bd0131e5dc}sponsorID', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dcf7a5e0-2798-45a4-863e-f0a66cd708d3}sponsorName', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{72787de1-a5a6-4438-9462-caad284d15e7}reasonForStatus', }, ), columns: { a!gridColumn( label: "Status", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status', value: a!tagField( labelPosition: "COLLAPSED", tags: { a!tagItem( text: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'], backgroundColor: if( fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'] = "Rejected", "#E06666", if( fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'] = "Pending", "#F6B26B", if( fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'] = "Accepted", "#93C47D", if( fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'] = "Executed", "#085394", if( fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dca6bd6b-27b7-4ffd-acc4-ccc7cc46c7f8}status'] = "In Progress...", "#666666", "" ) ) ) ) ), textColor: "#FFFFFF" ) }, size: "STANDARD" ), align: "START", width: "NARROW" ), a!gridColumn( label: "Reason for Status", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{72787de1-a5a6-4438-9462-caad284d15e7}reasonForStatus', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{72787de1-a5a6-4438-9462-caad284d15e7}reasonForStatus'], width: "MEDIUM" ), a!gridColumn( label: "View", value: a!richTextDisplayField( value: { a!richTextIcon( icon: "external-link", caption: concat( "View Details for - " & fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{270468e8-43ba-4161-9759-f6113cd3f821}emailSubject'] ), link: a!recordLink( label: "Record Link", recordType: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails', identifier: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{e31d1ef3-fd9a-4f89-a7cf-7fed8ee0cf0a}id'], dashboard: "summary", openLinkIn: "NEW_TAB" ), linkStyle: "STANDALONE" ) } ), backgroundColor: "NONE", align: "CENTER", width: "NARROW" ), a!gridColumn( label: "Email Subject", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{270468e8-43ba-4161-9759-f6113cd3f821}emailSubject', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{270468e8-43ba-4161-9759-f6113cd3f821}emailSubject'], width: "NARROW" ), a!gridColumn( label: "File Name", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{c83a9af9-bf52-48cd-9aac-beb41183db38}fileName', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{c83a9af9-bf52-48cd-9aac-beb41183db38}fileName'] ), a!gridColumn( label: "Error Message", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{611abf1e-fdce-4140-9a63-e8e7a62d0d0a}emailErrorMessage', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{611abf1e-fdce-4140-9a63-e8e7a62d0d0a}emailErrorMessage'] ), a!gridColumn( label: "Email Date", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{6ecb31a1-3938-42ce-8216-d21c282fea1b}emailDate', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{6ecb31a1-3938-42ce-8216-d21c282fea1b}emailDate'] ), a!gridColumn( label: "Sponsor ID", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{d12cf7a6-51ef-4554-9d3b-16bd0131e5dc}sponsorID', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{d12cf7a6-51ef-4554-9d3b-16bd0131e5dc}sponsorID'] ), a!gridColumn( label: "Sponsor Name", sortField: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dcf7a5e0-2798-45a4-863e-f0a66cd708d3}sponsorName', value: fv!row['recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{dcf7a5e0-2798-45a4-863e-f0a66cd708d3}sponsorName'] ), }, initialSorts: { a!sortInfo( field: 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.fields.{6ecb31a1-3938-42ce-8216-d21c282fea1b}emailDate', ascending: false ) }, selectable: true, selectionStyle: "CHECKBOX", selectionValue: local!selection, selectionSaveInto: { local!selection, /* This save adds the full rows of data for items selected in the most recent user interaction to local!selectedClaims. */ a!save( local!selectedEmails, append(local!selectedEmails, fv!selectedRows) ), /* This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedClaims. */ a!save( local!selectedEmails, difference(local!selectedEmails, fv!deselectedRows) ), }, showSelectionCount: "AUTO", shadeAlternateRows: true, refreshOnVarChange: { local!refreshGrid }, refreshAfter: "RECORD_ACTION", userFilters: { 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.filters.{c2fa124e-af1b-45e3-aa30-0b9cb0a2825c}Status', 'recordType!{a18957da-4220-4c94-bab7-2f402e373861}CSR_RT_FailedFileEmails.filters.{7c22b0a6-f943-499d-8561-04ac513a9085}Emails From/To', }, showSearchBox: true, showRefreshButton: true, recordActions: {}, pageSize: 15, pagingSaveInto:{ a!save(local!pagingInfo, fv!pagingInfo), } ) } ), a!columnLayout( contents: { a!cardLayout( height: "EXTRA_SHORT", showBorder: false() ), a!cardLayout( contents: { a!richTextDisplayField( label: "Selected Emails: (" & count(local!selection) & ")", value: {} ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Delete Selected Emails", saveInto: { a!startProcess( processModel: cons!CSR_CONS_DeleteEmails, processParameters: { FailedFileEmails: local!selectedEmails }, ), a!save(local!selection, null()), a!save(local!selectedEmails, null()), a!save( local!refreshGrid, if( local!refreshGrid = true(), false(), true() ) ), }, size: "SMALL", style: "OUTLINE", color: "#E06666", disabled: a!isNullOrEmpty(local!selection) )
Discussion posts and replies are publicly visible
Using URL parameters, you can implement a consistent navigation. You might have to query the data into a separate local to manage the paging info yourself.
docs.appian.com/.../url-parameters.html
I agree with this approach - and in particular, notice that OP is doing a "paging save into", but for no reason - the saved paging info is never actually used (since he's using internal paging).
Stefan Helzle said:You might have to query the data into a separate local to manage the paging info yourself.
Hi Mike, Yes, I forgot to delete that since it didn't affect the current result, but I did try using it in various places, such as saving the page on button click of the action, and I do see in local variables that it does 'preserve' the startIndex, but the grid refreshes nevertheless. I also tried using a!queryRecordType to display the data since it has a pagingInfo parameter however, that way, it doesn't allow user filters on the grid, which I also need
Also, just seeing Stefan's full response, I'll look into that as well.
nel4035 said:it doesn't allow user filters on the grid
you can build your own filters on-form, which takes more work up-front, but provides a lot more power and flexibility. i usually just default to that methodology, except for in unusually simple cases.