Hello. I have a read-only grid that displays permissions data using a!recordData() as the data source. Currently, I can only capture the record IDs when users manually select rows in the grid using the selectionSaveInto parameter.
a!recordData()
selectionSaveInto
My Goal:I want to automatically save all the record IDs returned by the a!recordData() query without requiring user selection and without using a!queryRecordType() in a separate expression or local variable.
Current Implementation:
a!gridField( label: "Permissions to Transfer:", instructions: "A temporary access group will be created to grant the selected permissions from the source employee to the destination employee.", helpTooltip: "Permissions that would generate risk combination or already belong to the Destination Employee have been hidden", labelPosition: "ABOVE", data: a!recordData( recordType: 'recordType!{57571bf8-20a7-4874-ac82-7f586277be58}GDA Permissao Acesso', filters: rule!GDA_QueryFilter_BuscarPermissoesPorAreaOuColaborador( idColaborador: ri!data.idColaboradorOrigem, idPermissoesOmitidas: a!flatten({ local!idsPermissoesColaboradoresJaPossuem, local!idsPermissoesToxicas }), moduloFuncionalidadePermissaoIdValues: a!flatten({ local!idValuesPermissoesDestinoJaPossui, local!idValuesPermissoesToxicasComDestino }) ) ), columns: { a!gridColumn( label: "Module - Functionality - Permission", sortField: 'recordType!{57571bf8-20a7-4874-ac82-7f586277be58}GDA Permissao Acesso.relationships.{c489989c-3175-42e4-9d14-3d0d8a394dec}funcionalidade.fields.{bd31af22-64ea-49a7-918c-04a269b09261}moduleId', value: a!defaultValue( fv!row['recordType!{57571bf8-20a7-4874-ac82-7f586277be58}GDA Permissao Acesso.fields.{f62ba409-1519-4117-befd-631ee260a10b}moduloFuncionalidadePermissaoText'], "–" ) ) }, selectionSaveInto: { a!save(ri!data.selecaoPermissoes, fv!selectedRows) }, showSearchBox: false, showRefreshButton: false, showWhen: and( not(local!origemNaoPossuiPermissoes), a!isNotNullOrEmpty(ri!data.idColaboradorOrigem), a!isNotNullOrEmpty(ri!data.idColaboradorDestino) ) )
What I'm Looking For:
a!gridField()
a!queryRecordType()
fv!currentPage
Questions:
pagingSaveInto
validations
refreshOnVarChange
I understand that using a!queryRecordType() in a local variable is the standard approach, but I'm exploring if there's a more integrated solution within the grid component itself to avoid query duplication and improve performance.
Any insights or creative solutions would be greatly appreciated!
Thank you all for your help!
Discussion posts and replies are publicly visible
Without any user action, like paging changes or selection, there is no way to store all the ids to the grid on load. So you will have to use either pagingsaveInto (which will save only when user changes the page of grid) or selection save into (which saves on selection of row).
This doesn't work for me, I need to be instantly. But I appreciate it anyways.
BTW how to properly replace a!recordData by a a!queryRecordType? Speally on the grid and the records are above the amount of 5K, how to make the variables deal with the next batch?
Supposing e.g we have 15,000 records.
Because the main utility of a a!ecordData is that it deals with it for you, what if beyond a a!recordData I need a a!queryRecord to work accordingly with my a!recordData query?
No direct way in a!gridField to auto-save all a!recordData record Ids without selection or duplicating query in local var.There is no workaround using pagingSaveInto, fv!currentPage, or hidden grid features to automatically capture IDs from a!recordData()