Unmark row(s) for deletion fails to unmark context row(s) because Model property is not set

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
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:
1) 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")
2) Preview page
3) Remove the value for the Account Name in Row #1
4) 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>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Barry,

I see what you're talking about with an in-place upgrade of the page not working on the first try. However, when I click on mark rows for deletion and unmark rows for deletion in your row action (without actually changing anything), the pagebuilder fixes itself, so to speak. The pagebuilder save is enabled, and if I save and then preview, the page works as expected. I think behind the scenes the new properties are being added to the XML. Do you see this behavior?

I can see how it can be confusing for the Model property being required when you choose rows in context, so I'll pass on that suggestion to the devs.

Thanks!
Amy
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Ah, sorry Barry, I wasn't clear enough. I didn't actually change/toggle the action types, but just clicked on the mark and unmark action to view their details. That's probably splitting hairs, but I think it's a little better than having to change the value back and forth. I'm not sure if there is a specific reason why we require the model when we're doing context, so I'll bring that up to the team to find out.

Thanks!
Amy
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Sounds great Amy, appreciate you checking with the team.  Look forward to an update, thank you!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Hello Amy - Any updates on this?  Thank you!
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Barry,

I finally talked to the team about this. They agree that it would be good to hide a model selection when you choose context, but it will probably be a bit before that gets implemented because there are bigger fish to fry, so to speak :) 
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Thanks for the follow-up Amy, greatly appreciated.  Glad to hear we're all in agreement, understood regarding priority :)