a!localVariables( local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 20 ), local!gridData: a!queryEntity( entity: cons!BQA_Quiz_Cons, query: a!query( pagingInfo: local!pagingInfo ), fetchTotalCount: true ), a!formLayout( label: "Example: Add,Update, or Remove Employee Data", contents: { a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label: "Chapter Name"), a!gridLayoutHeaderCell(label: "File Upload"), a!gridLayoutHeaderCell(label: "Description"), a!gridLayoutHeaderCell(label: "Total Questions") }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ), a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ) }, rows: a!forEach( items: local!gridData, expression: a!gridRowLayout( contents: { a!textField( label: "chapterName" & fv!index, value: fv!item.chapterName, saveInto: fv!item.chapterName, required: true ), a!fileUploadField( label: "fileUpload" & fv!index, value: fv!item.fileUpload, saveInto: fv!item.fileUpload, required:true ), a!textField( label: "totalQuestion" & fv!index, value: fv!item.totalQuestion, saveInto: fv!item.totalQuestion, required:true ), a!textField( label: "description" & fv!index, value: fv!item.description, saveInto: fv!item.description, required:true ), }, id: fv!index ) ), addRowlink: a!dynamicLink( label: "Add Employee", value: { chapterName: "", fileUpload: {}, totalQuestion: "", description: "" }, saveInto: { a!save(local!gridData, append(local!gridData, save!value)) } ), rowHeader: 1 ) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidget( label: "Submit", submit: true ) ) ) )
Discussion posts and replies are publicly visible
Hi,
I have created like u said but i am getting error did i have to use record type for this
When you Query the output comes in as "DataSubset". Same thing is happening in your case .Type of local!griddata is "DATASUBSET". And when you are trying to add another row, save!Value is of your CDT type. It leads to Casting error
I Just observed it in your grid is it showing the right data?? and when you try to update, is it happening properly without any errors?? I mean your index needs to look like this fv!item.data.chaptername .
As you are using queryEntity, you need to use CDT types.
But your mistake is, that you create an item instead of referencing the data type in line 7. Remove the emphasis after the type.
I got it now. Thank you for your guidance
Try To Cast Using a Loop it will take case of you dataset.