Hi ,
I have a scenario like I have a local value
local!data :{
{id:1,name:"abc",value1:"No"},
{id:2,name:"def",value1:"No"}
}
Now I am showing this data in a grid and it can be selected so I am selecting the first row and I could able to save the entire row in a variable called
local!dataselected.
Now on click of a button say Edit.
I need to update the value of value1 which is selected to Yes from No
so on click of the button in a!save I am doing this
a!save(local!data.value1,updatearray(local!data.value1,wherecontains(local!selected.id,local!data.id),"Yes")
But I am facing this issues
"Cannot index the property of Cannot index property 'value1' into type List of Dictionary.
I saw a Knowledge base avialble for this but no response.
Can someone help me on this please.!!!
Discussion posts and replies are publicly visible
Hello!
Hope you are doing great,
you can use the following example:
load( local!data: { {id: 1,firstname: "Jeremie",lastname: "Romaguera",isActive: "Yes"}, {id: 2,firstname: "Alda",lastname: "Wiza",isActive: "Yes"}, {id: 3,firstname: "Carolyn",lastname: "Spencer",isActive: "Yes"}}, local!selected_pagingInfo: a!gridSelection( selected: {}, pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 5, sort: a!sortInfo(field: "firstname",ascending: true) ) ), local!updatedInformation: null, a!formLayout( contents: { a!textField( label: "TEST-SELECTED VALUES", readOnly: true, value: local!selected_pagingInfo.selected ), a!gridField( totalCount: count( local!data ), columns: { a!gridTextColumn( label: "First name", field: "firstname", data: property(local!data,"firstname",null) ), a!gridTextColumn( label: "Last name", field: "lastname", data: property(local!data,"lastname",null) ), a!gridTextColumn( label: "Active ?", field: "isActive", data: property(local!data,"isActive",null) ) }, identifiers: property(local!data,"id",null), value: local!selected_pagingInfo, saveInto: local!selected_pagingInfo, selection: true ), a!textField( label: "TEST-INFORMATION UPDATED", readOnly: true, value: local!updatedInformation ) }, buttons: { a!buttonArrayLayout( buttons: a!buttonWidgetSubmit( label: "save", style: "PRIMARY", saveInto: { a!save( target: local!updatedInformation, value: a!forEach( items: local!selected_pagingInfo.selected, expression: load( local!getSelectedData: index(local!data,fv!item,null), a!forEach( items: local!getSelectedData, expression: { id: property(fv!item,"id",null), firstname: property(fv!item,"firstname",null), lastname: property(fv!item,"lastname",null), isActive: "No" } ) ) ) ) } ) ) } ) )
On this example you will find the following:
I encourage to see this example, although I do not recommend using this way.
What I recommend is the following:
I am looking forward to hearing from you, regards.