I have a record type list - saved in local!displayitems it has 9 items and i am displaying it in the grid
when I select the rows in grid it gets saved in the local!selectedrow variable
now, i am doing some manipulation and updating few fields in the selected rows and then wanted to save them to the local!display items upon button click , here is teh code, can you tell me what is wrong , since displayitems is nested , i flattened it
a!forEach( items:a!flatten(ri!displayItems), expression:{ a!save(fv!item[recordtype.fields.preparedBy'], a!update( fv!item[recordtype.fields.preparedBy'], { index(
fv!item[recordtype.fields.procedureReferenceId'], ri!selectedrows[recordtype.fieldsprocedureReferenceId'] ) },{ri!selectedrows[recordtype.fields.preapredby]} ) )
error:
Discussion posts and replies are publicly visible
hi kowsalyavijayan could try something like this by making changes to the below code as per your requirement
a!forEach( items: a!flatten(local!selectedrow), expression: { a!save( local!displayitems[ wherecontains( fv!item[recordtype.fields.procedureReferenceId], a!flatten(local!displayitems[recordtype.fields.procedureReferenceId]) ) ][recordtype.fields.preparedBy], fv!item[recordtype.fields.preparedBy] ) } )
error:An error occurred while executing a save: Expression evaluation error at function 'wherecontains' parameter 1 [line 183]: Invalid index: Cannot index property 'fields' of type Text into type RecordType
did you change the code ? as per your requirement?
yes
will try again
it does update the flattened local!displayitems, but in the grid I have unflattened local!disaply items .something like dis,
after using the expression , the update is like,
, this impacts the grid
I tried alternate way of displaying grid, but your query helped a lot. Thanks