How to Save Record Data IDs from a!gridField a!recordData Without Selection or a!queryRecordType()
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.
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 way to dynamically capture all record identifiers from the
a!recordData()query result directly within thea!gridField()configuration - Avoid duplicating the query logic with
a!queryRecordType()in a separate local variable - Ideally leverage grid function variables like
fv!currentPageor similar mechanisms to access the underlying data identifiers - A more dynamic approach that doesn't require explicit column selection or user interaction
Questions:
- Is there a way to access the complete dataset or identifiers from
a!recordData()within the grid configuration itself? - Can I use parameters like
pagingSaveIntoorvalidationswithfv!currentPageto extract IDs automatically? - Are there any undocumented function variables or techniques that would allow me to capture all returned record IDs without selection?
- Would using
refreshOnVarChangecombined with a specific save pattern help achieve this?
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!
