I am trying to save data that is updated in an editable grid, but when I save the data - everything saves correctly except that the ids. Existing table, ABC_Customer has id, name, accountNum, fiId, effectiveDate. I have a read only grid that the allows the user to select which rows to update. the selection of rows is then displayed in a new grid that has editable data.
This is a follow-on question related to a previous post of mine, but since it's a new topic - thought I'd create a new item. Anyway - this is what I hav
a!dropdownField( label: "Account Number "&fv!index, choiceLabels: {ri!selectedAccount_cdt.accountNum, ri!newAccount_cdt.accountnum}, choiceValues: {ri!selectedAccount_cdt.accountNum, ri!newAccount_cdt.accountnum}, value: fv!item.accountNum, saveInto: {fv!item.accountNum, if(fv!item.accountNum = ri!newAccount_cdt.accountNum, a!save( target: ri!updatedCustomerAccount_cdt.fiId, value: ri!newAccount_cdt.fiId ), a!save( target: ri!updatedCustomerAccount_cdt.fiId, value: local!selectedRows.fiId ) ), if(fv!item.accountNum = ri!newAccount_cdt.accountNum, a!save( target: ri!updatedCustomerAccount_cdt.effectiveDate, value: today() ), a!save( target: ri!updatedCustomerAccount_cdt.effectiveDate, value: local!selectedRows.effectiveDate ) ), if(fv!item.accountNum = ri!newAccount_cdt.accountNum, a!save( target: ri!updatedCustomerAccount_cdt.accountNum, value: ri!newAccount_cdt.accountNum ), a!save( target: ri!updatedCustomerAccount_cdt.accountNum, value: local!selectedRows.accountNum ) ), a!save( target: ri!updatedCustomerAccount_cdt.CustomerId, value: local!selectedRows.CustomerId ), a!save( target: ri!updatedCustomerAccount_cdt.aipCode, value: ri!newAccount_cdt.aipCode ) }, required: true() ),
Discussion posts and replies are publicly visible
Tried another route that worked. I start with a readOnly grid that's selectable - (i.e., the user selects the rows that should be updated to the new account number) - then a second grid displays that is readOnly as well, populated by the selected rows from the first grid. The selected rows displayed in the 2nd grid have the updated account number and today() as the effective date. Since they are readOnly columns - you can't save that data, but I included a series of a!save() lines on the submit button. That worked! Hope this helps someone else!