When a new row has been created in a model and is marked for deletion, if the “save” fails, the row is removed from the model.
Steps to Reproduce:
- Add a validation rule to Account where Name = “Test123” (don’t allow accounts with name of “Test123”
- Create Tab page for Account
- Mark “Save” button to “rollbackOnError=true”
- Add new row to table with Name of “TestABC”
- Add new row to table with Name of “Test123”
- Mark row “TestABC” for delete
- Click Save
Expected Behavior
Both rows remain in model/table due to validation error that occurs on “Test123” row
Actual Behavior
“TestABC” row removed from model/table
Analysis
removeRowById is called prior to remote save operation occurring.
Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account">
<maintitle>
<template>{{Model.labelPlural}}</template>
</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions>
<action type="savecancel" rollbackonanyerror="true"/>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="read">
<fields>
<field id="Name" allowordering="true"/>
<field id="CreatedDate" allowordering="true"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>