Clarification on a!writeToDataStoreEntity

My data table has 5 columns with data. In the UI i am rendering only 2 fields to edit i an editable grid. While saving it overwrites the other field values as null. Is this an expected behavior ?How to avoid it ? I want to retain the value in the fields that are not brought to the UI at all.

  Discussion posts and replies are publicly visible

Parents Reply
  • please find the code below
    = load(
    local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    ),
    local!data: a!queryEntity(
    entity: cons!MY_DB_ENTITY,
    query: a!query(
    selection: a!querySelection(
    columns: {
    a!queryColumn(
    field: "expense_id",
    alias: "expense_id"
    ),
    a!queryColumn(
    field: "expenseItem",
    alias: "expenseItem"
    ),
    a!queryColumn(
    field: "expenseType",
    alias: "expenseType"
    )
    }
    ),
    pagingInfo: local!pagingInfo
    )
    ),
    a!dashboardLayout(
    contents: {
    a!buttonArrayLayout(
    buttons: a!buttonWidget(
    label: "Save",
    saveInto: {
    a!writeToDataStoreEntity(
    cons!MY_DB_ENTITY,
    local!data.data
    )
    }
    )
    ),
    a!gridLayout(
    label: "Label",
    labelPosition: "ABOVE",
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Header1",
    showWhen: false
    ),
    a!gridLayoutHeaderCell(
    label: "Header2"
    ),
    a!gridLayoutHeaderCell(
    label: "Header3"
    )
    },
    columnConfigs: {},
    rows: a!forEach(
    items: local!data,
    expression: {
    a!gridRowLayout(
    id: fv!item.expense_id,
    contents: {
    a!textField(
    label: "expitem",
    value: fv!item.expense_id,
    saveInto: fv!item.expense_id,
    showWhen: false
    ),
    a!textField(
    label: "expitem1",
    value: fv!item.expenseItem,
    saveInto: fv!item.expenseItem
    ),
    a!textField(
    label: "expType",
    value: fv!item.expenseType,
    saveInto: fv!item.expenseType
    )
    }
    )
    }
    ),
    selectionSaveInto: {},
    validations: {},
    shadeAlternateRows: true
    )
    }
    )
    )
Children