Hi,
I am displaying a table in a Read only grid based on Drop down selection from another table.
I am able configure update Emp action in Emp type in drop down as I am catching Primary key but I want to configure the same in the Grid for updating the Emp Sub Type.
For one Emp in drop down there are few sub types getting displayed in Grid. This grid has also Primary key associated for sub type table.
I want to catch Primary for one selected row to use update action on Sub EMP type in GRID.
Could someone help me here plz how to do?
The UI looks like
code I am using
a!localVariables( local!typeData:rule!FF_EMP_QE_EmpTypes(empType: null), local!empType, local!typeId:index(local!typeData.typeid,wherecontains(local!empType,touniformstring(local!typeData.emptype)),{}),
{ /*a!textField(*/ /*value: index(local!typeData.typeid,wherecontains(local!empType,local!typeData.emptype),{})),*/ a!textField(value: wherecontains(local!empType,touniformstring(local!typeData.emptype))), /*a!textField(*/ /*value: index(rule!FF_EMP_SubType(empId: ri!subEmpIds),"empsubtype",{}),*/ /*),*/
a!sectionLayout( label: "", contents: { a!columnsLayout( columns: a!columnLayout( contents: { a!dropdownField( label: "Employee Types", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: {local!typeData.emptype}, choiceValues: {local!typeData.emptype}, value:local!empType, saveInto: {local!empType}, searchDisplay: "AUTO", validations: {} ) } ) ), a!gridField( data: a!queryEntity( entity: cons!FF_ENT_EMPSUBTYPE, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field: "empsubtype" ), a!queryColumn( field: "emptype" ), a!queryColumn( field: "typeid" ), a!queryColumn( field: "empid" ) } ), filter:if(isnull(local!empType),null,a!queryFilter( field: "emptype", operator: "=", value: local!empType )), pagingInfo: fv!pagingInfo ), fetchTotalCount: true ), columns: { a!gridColumn( label: "Empsubtype", sortField: "empsubtype", value: fv!row.empsubtype ), a!gridColumn( label: "Emptype", sortField: "emptype", value: fv!row.emptype ), a!gridColumn( label: "Typeid", sortField: "typeid", value: fv!row.typeid ), a!gridColumn( label: "Empid", sortField: "empid", value: fv!row.empid ) }, pageSize: 20, initialSorts: {} ), a!recordActionField( actions: {a!recordActionItem( action: 'recordType!{abd29c56-81fd-455f-a4d9-25cee496c62c}FF_EMP_RC_Detail.actions.{33cc01b3-6f31-47b8-a75f-d5eacfbd1169}addEmp' ), a!recordActionItem( action: 'recordType!{abd29c56-81fd-455f-a4d9-25cee496c62c}FF_EMP_RC_Detail.actions.{888454cb-b159-4263-8c01-a771c96ff919}updateDetails', identifier:local!typeId )} ) },
) })
Discussion posts and replies are publicly visible
Please use this to paste code.
Did you check this pattern?
docs.appian.com/.../grid-with-selection-pattern.html
Thank you for the suggestion for pasting the codes. I was not aware. It is nice.
The document did help me but I wanted to catch a primary key and the similar page helped after this to catch the primary Id or selected rows id.
Now I have another understanding issues related to the code used in Use Links in a Grid to Show More Details and Edit Data - Appian 21.2.
how do the code work from line 57 to 64. how are the variables getting saved sequentially . To me it is saving null but how the selected row is always showing the latest row?
Thanks
Faisal
It is not clear to me what your question is.
Does that code work for you?
Do you struggle to understand what is going on?
The comments in the code are a good description. Do you have any concrete questions?
I am little confused with these two index functions:
index(fv!selectedRows, length(fv!selectedRows),null) and
index(save!value, length(save!value), null)I understand the index function functionality but here what are they doing I am not able to understand.How they are helping the user to restrict the selection to only one row at a time?Need help to understand.
The comment says
/* Using the index function to return the last-selected item ensures that only one item will be selected at a time, regardless of how fast the user clicks. */save!value are all items the user select. When clicking fast this could be more than one.