This stems from Rows not being unmarked for deletion after Model Save Fails
With 9.3.1, the “Model” property is still required when using “Unmark row(s) for deletion” even when choosing “Rows in Context.”
Unfortunately, an in-place upgrade of the sample page mentioned in the post above still fails to function properly with Brooklyn. The reason is that there is no model property (because that property didn’t exist in previous versions on unmark row in context). In order to get the page to work properly, you must go in to the XML to add the property or change Rows to use to “all” then back to “rows in context” (assuming you only have a single model on your page).
As discussed in the above post, when using “Context”, a model property should not be required. I see that in Brooklyn, “unmark row(s) for deletion” appears to be combined with “Unmark all row(s)” and they’ve become essentially the same thing under the covers. That said, configuration of a model property should not be needed when using context - context is context and model & rows are already known. Requiring a model property creates unnecessary maintenance for the page developer and increases risk of defects due to having to change this value if/when the model for the table row ever changes.
Proposed fix, as discussed previously, is to only have a “Model” property if “Rows to use” is “All Rows in Model”
Steps to reproduce:
- Create page from sample XML below (this is taken directly from previous post with the only change being changing the “Save” button to use “All rows in model” instead of “Rows in Context”)
- Preview page
- Remove the value for the Account Name in Row #1
- Click the square icon on row #2
Expected Behavior
Save should fail, error message displayed at top and Row #2 should be “unmarked for deletion”
Actual Behavior
Save fails, error message displayed but Row #2 is still “marked for deletion”
Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" 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" uniqueid="sk-3k7qR-110">
<maintitle>
<template>{{Model.labelPlural}}</template>
</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions>
<action type="multi" label="Save" icon="sk-icon-save">
<actions>
<action type="save" rollbackonanyerror="true">
<onerroractions>
<action type="unmarkRowsForDeletion" message="There was an error" timeout="3000" model="Account" affectedrows="all"/>
</onerroractions>
<models>
<model>Account</model>
</models>
</action>
</actions>
</action>
<action type="multi" label="Cancel" icon="sk-icon-cancel">
<actions>
<action type="cancel">
<models>
<model>Account</model>
</models>
</action>
</actions>
</action>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="edit" uniqueid="sk-3k7qR-111" emptysearchbehavior="query">
<fields>
<field id="Name" allowordering="true"/>
<field id="CreatedDate" allowordering="true"/>
</fields>
<rowactions>
<action type="delete"/>
<action type="multi" label="Delete With Save" icon="fa-stop">
<actions>
<action type="markRowsForDeletion" model="Account"/>
<action type="save" rollbackonanyerror="true">
<models>
<model>Account</model>
</models>
<onerroractions>
<action type="unmarkRowsForDeletion" message="There was an error" timeout="3000"/>
</onerroractions>
</action>
</actions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
<searchfields/>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>