Save Button Type Rendering Issue

  • 2
  • Problem
  • Updated 10 months ago
  • Solved
The status "Saving..." doesn't go away after clicking save and the models save successfully.

May have something to do with the action to re-query the model on save.
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb

Posted 1 year ago

  • 2
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
It could be that you're creating an infinite loop where it is constantly saving. If a save leads to a query and a query leads to a save, then it could go on forever. Could you share your XML?
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb
It doesn't appear to be in a loop, or i would have expected more network activity after the two apexremote operations to query my two models.

I'm willing to share the XML of my page - what's the best way to do this without just posting my whole page directly on the board?

Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Unfortunately, this is what I see when I run the page. I then have to take out the aggregate models. 


I haven't seen anything like the "saving..." not going away before. I'm thrilled to see that it is working. When I make your page work for me, the "saving..." goes away almost immediately. You might want to double check your aggregate models and conditions to make sure they are aggregating properly.

A few questions:
Are your themes up to date? If they are, you won't see this button. It's a far chance but it could be this.

Also, have you tried this in a different browser? Do you see it elsewhere? On what browsers have you seen it
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb
I'm using a custom theme, let me try remaking the page in a standard theme and seeing if the save button misbehaves.
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb
Ok, I remade this page in the classic theme, stripped out the environment/data specific references, and still am encountering the problem. Hopefully this XML will work for you without modification. This runs for me with my data, so I'm not sure why the "saving..." label is hanging around.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="false" showheader="true" theme="Classic">
    <models>
        <model id="CasesByClient" limit="2000" query="true" createrowifnonefound="false" datasource="salesforce" type="aggregate" sobject="Case">
            <fields>
                <field id="Id" name="countId" function="COUNT"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="Collections" enclosevalueinquotes="true" field="RecordType.DeveloperName"/>
            </conditions>
            <actions/>
            <groupby method="simple">
                <field id="Client__c" name="clientc"/>
                <field id="Client__r.Name" name="clientrName"/>
            </groupby>
        </model>
        <model id="CasesByOwner" limit="" query="true" createrowifnonefound="false" datasource="salesforce" type="aggregate" sobject="Case">
            <fields>
                <field id="Id" name="countId" function="COUNT"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="Collections" enclosevalueinquotes="true" field="RecordType.DeveloperName" state=""/>
            </conditions>
            <actions/>
            <groupby method="simple">
                <field id="OwnerId" name="ownerId"/>
                <field id="Owner.Name" name="ownerName"/>
            </groupby>
        </model>
        <model id="Cases" limit="2000" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Case" doclone="">
            <fields>
                <field id="Case_Number__c"/>
                <field id="OwnerId"/>
                <field id="Owner.Name"/>
                <field id="Date1__c"/>
                <field id="Client__c"/>
                <field id="Client__r.Name"/>
                <field id="Review_Date__c"/>
                <field id="Subject"/>
                <field id="Sub_Status__c"/>
                <field id="Client__r.Company_Number__c"/>
                <field id="Primary_Status__c"/>
                <field id="Id"/>
                <field id="Total_Balance__c"/>
                <field id="Age_Since_Task_Status_Change__c"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="Collections" enclosevalueinquotes="true" field="RecordType.DeveloperName"/>
                <condition type="fieldvalue" value="false" enclosevalueinquotes="false" field="IsClosed"/>
                <condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="IsReviewDue__c" state="filterableoff" inactive="true" name="IsReviewDue__c"/>
                <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="OwnerId" fieldtargetobjects="Group,User" state="filterableoff" inactive="true" name="OwnerId"/>
                <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Client__c" fieldtargetobjects="Account" state="filterableoff" inactive="true" name="Client__c"/>
                <condition type="multiple" field="Primary_Status__c" operator="in" inactive="true" enclosevalueinquotes="true" name="__autofilter__Primary_Status__c" state="filterableoff" value=""/>
                <condition type="fieldvalue" value="5001A00001MSarZQAT" enclosevalueinquotes="true" field="Id" operator="!="/>
            </conditions>
            <actions>
                <action>
                    <actions>
                        <action type="updateRow" fieldmodel="Cases" affectedrows="context" field="RecordTypeId" enclosevalueinquotes="true" value="0121A000000CDai"/>
                    </actions>
                    <events>
                        <event>row.created</event>
                    </events>
                </action>
                <action>
                    <actions>
                        <action type="requeryModels" model="CasesByOwner" behavior="standard">
                            <models>
                                <model>CasesByOwner</model>
                                <model>Cases</model>
                            </models>
                        </action>
                    </actions>
                    <events>
                        <event>models.saved</event>
                    </events>
                </action>
            </actions>
        </model>
        <model id="CaseComments" limit="" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="CaseComment" orderby="CreatedDate DESC">
            <fields>
                <field id="ParentId"/>
                <field id="Parent.CaseNumber"/>
                <field id="CommentBody"/>
                <field id="CreatedDate"/>
                <field id="CreatedById"/>
                <field id="CreatedBy.Name"/>
            </fields>
            <conditions>
                <condition type="modelmerge" value="" field="ParentId" fieldtargetobjects="Case" operator="in" model="Cases" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
            </conditions>
            <actions/>
        </model>
        <model id="Task" limit="" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Task">
            <fields>
                <field id="Case__c"/>
                <field id="Case__r.CaseNumber"/>
                <field id="Status"/>
                <field id="Subject"/>
                <field id="Type"/>
                <field id="CreatedDate"/>
                <field id="ActivityDate"/>
                <field id="OwnerId"/>
                <field id="Owner.Name"/>
                <field id="RecordType.DeveloperName"/>
                <field id="RecordTypeId"/>
                <field id="RecordType.Name"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="Collections" enclosevalueinquotes="true" field="Case__r.RecordType.DeveloperName" operator="="/>
            </conditions>
            <actions/>
        </model>
        <model id="FinancialItems" limit="2000" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Financial_Item__c">
            <fields>
                <field id="Item_ID__c"/>
                <field id="Balance_Due__c"/>
                <field id="Case__c"/>
                <field id="Case__r.CaseNumber"/>
                <field id="Client_Name__c"/>
                <field id="Defect__c"/>
                <field id="Past_Due__c"/>
                <field id="Notes__c"/>
                <field id="DefectPL__c"/>
                <field id="Sub_CategoryPL__c"/>
                <field id="CategoryPL__c"/>
            </fields>
            <conditions/>
            <actions>
                <action>
                    <actions>
                        <action type="save">
                            <models>
                                <model>FinancialItems</model>
                            </models>
                        </action>
                    </actions>
                    <events>
                        <event>row.updated</event>
                    </events>
                    <fields>
                        <field>Defect__c</field>
                    </fields>
                </action>
                <action>
                    <actions>
                        <action type="requeryModel" model="Cases" behavior="standard"/>
                    </actions>
                    <events>
                        <event>models.saved</event>
                    </events>
                </action>
            </actions>
        </model>
    </models>
    <components>
        <buttonset uniqueid="sk-1NNvkB-465" model="Cases">
            <buttons>
                <button type="save" label="Save" uniqueid="sk-1NNw6g-469" window="self" icon="sk-icon-save">
                    <models>
                        <model>Cases</model>
                        <model>CaseComments</model>
                        <model>Task</model>
                        <model>FinancialItems</model>
                    </models>
                </button>
            </buttons>
        </buttonset>
        <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="false" model="Cases" buttonposition="" mode="read" allowcolumnreordering="false" uniqueid="sk-3L8NFe-138" emptysearchbehavior="query">
            <fields>
                <field id="Case_Number__c" hideable="false" uniqueid="fi-1M67Un-158" valuehalign="" type="" allowordering="false" showbydefault="true"/>
                <field id="Review_Date__c" hideable="false" uniqueid="fi-G9rIB-293" valuehalign="" type="" showbydefault="true"/>
                <field id="OwnerId" hideable="false" uniqueid="fi-1RBTw--163" valuehalign="" type="" optionsource="" pagesize="5" redirecttype="datasourcedefault" allowordering="true" showbydefault="true">
                    <label>Case Owner</label>
                    <filters/>
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                    <enableconditions/>
                </field>
                <field id="Client__r.Company_Number__c" hideable="false" uniqueid="fi-gRE38-381" valuehalign="" type="" showbydefault="true"/>
                <field id="Client__c" hideable="false" uniqueid="fi-2aESUB-215" valuehalign="" type="" allowordering="true" showbydefault="true">
                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                    <enableconditions/>
                </field>
                <field id="Primary_Status__c" hideable="false" uniqueid="fi-lRq3W-226" valuehalign="" type="" showbydefault="true"/>
                <field id="Subject" hideable="false" uniqueid="fi-GHdsP-391" valuehalign="" type="" showbydefault="true"/>
                <field id="Total_Balance__c" hideable="false" uniqueid="fi-uXnUK-229" decimalplaces="" valuehalign="" type="" showbydefault="true"/>
                <field id="Age_Since_Task_Status_Change__c" hideable="false" uniqueid="fi-vCxUr-225" decimalplaces="" valuehalign="" type="" showbydefault="true"/>
            </fields>
            <rowactions>
                <action type="edit"/>
                <action type="popup" label="View Comments" icon="sk-icon-comments">
                    <popup width="80%" title="Viewing Case {{Case_Number__c}} Comments">
                        <components>
                            <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="CaseComments" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-1Hvh7u-297">
                                <fields>
                                    <field id="CreatedById" hideable="false" uniqueid="fi-1SLIep-410" valuehalign="" type="" showbydefault="true" readonly="true" columnwidth="15%"/>
                                    <field id="CreatedDate" hideable="false" uniqueid="fi-1SLEZO-383" valuehalign="" type="" readonly="true" showbydefault="true" columnwidth="15%"/>
                                    <field id="CommentBody" hideable="false" uniqueid="fi-1HwaBB-361" valuehalign="" type="" showbydefault="true" columnwidth="70%">
                                        <label>Comment</label>
                                    </field>
                                </fields>
                                <rowactions>
                                    <action type="edit"/>
                                    <action type="delete"/>
                                </rowactions>
                                <massactions usefirstitemasdefault="true">
                                    <action type="massupdate"/>
                                    <action type="massdelete"/>
                                </massactions>
                                <views>
                                    <view type="standard"/>
                                </views>
                                <conditions>
                                    <condition type="contextrow" field="ParentId" mergefield="Id" autocreated="true" operator="="/>
                                </conditions>
                                <searchfields/>
                                <renderconditions logictype="and"/>
                            </skootable>
                        </components>
                    </popup>
                </action>
                <action type="popup" label="View Tasks" icon="sk-icon-activities">
                    <popup width="80%" title="Viewing Case {{Subject}} Tasks">
                        <components>
                            <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Task" buttonposition="" mode="read" allowcolumnreordering="false" responsive="true" uniqueid="sk-1N2vIR-277">
                                <fields>
                                    <field id="CreatedDate" hideable="false" uniqueid="fi-1Na5Sf-480" valuehalign="" type="" readonly="true" showbydefault="true"/>
                                    <field id="ActivityDate" hideable="true" uniqueid="fi-2fRq1o-234" valuehalign="" type="">
                                        <label>Due Date</label>
                                    </field>
                                    <field id="OwnerId" hideable="true" uniqueid="fi-2fqck1-267" valuehalign="" type=""/>
                                    <field id="Status" hideable="false" uniqueid="fi-1Na5Sf-481" valuehalign="" type="" showbydefault="true"/>
                                    <field id="Type" hideable="false" uniqueid="fi-1Na5Sf-483" valuehalign="" type="" showbydefault="true">
                                        <renderconditions logictype="and" onhidedatabehavior="keep"/>
                                        <enableconditions logictype="and"/>
                                    </field>
                                    <field id="Subject" hideable="false" uniqueid="fi-1Na5Sf-482" valuehalign="" type="" showbydefault="true"/>
                                    <field id="RecordTypeId" hideable="true" uniqueid="fi-1NUdwN-628" valuehalign="" type=""/>
                                    <field id="RecordType.Name" hideable="true" uniqueid="fi-1NUemJ-650" valuehalign="" type=""/>
                                </fields>
                                <rowactions>
                                    <action type="edit"/>
                                    <action type="delete"/>
                                </rowactions>
                                <massactions usefirstitemasdefault="true">
                                    <action type="massupdate"/>
                                    <action type="massdelete"/>
                                </massactions>
                                <views>
                                    <view type="standard"/>
                                </views>
                                <conditions>
                                    <condition type="contextrow" field="Case__c" mergefield="Id" autocreated="true" operator="="/>
                                </conditions>
                                <searchfields/>
                                <renderconditions logictype="and"/>
                            </skootable>
                        </components>
                    </popup>
                </action>
                <action type="drawer" label="View Items" icon="sk-icon-dollar">
                    <drawer title="Drawer Area" width="90%" closehandle="true">
                        <components>
                            <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" alwaysresetpagination="false" createrecords="false" model="FinancialItems" buttonposition="" mode="read" allowcolumnreordering="false" responsive="false" uniqueid="sk-BZtiG-237" emptysearchbehavior="query">
                                <fields>
                                    <field id="Item_ID__c" hideable="false" uniqueid="fi-BZym4-251" valuehalign="" type="" showbydefault="true"/>
                                    <field id="Balance_Due__c" hideable="false" uniqueid="fi-BZym4-252" valuehalign="" type="" showbydefault="true"/>
                                    <field id="Past_Due__c" hideable="false" uniqueid="fi-BZym5-253" valuehalign="" type="" showbydefault="true"/>
                                    <field id="DefectPL__c" hideable="false" uniqueid="fi-fMq_u-230" valuehalign="" type="" showbydefault="true">
                                        <label>Defect</label>
                                    </field>
                                    <field id="Notes__c" hideable="false" uniqueid="fi-Qcglz-224" valuehalign="" type="" showbydefault="true"/>
                                    <field id="CategoryPL__c" hideable="false" uniqueid="fi-gO9p0-294" valuehalign="" type="" showbydefault="true"/>
                                    <field id="Sub_CategoryPL__c" hideable="false" uniqueid="fi-gO80q-283" valuehalign="" type="" showbydefault="true"/>
                                </fields>
                                <rowactions>
                                    <action type="edit"/>
                                </rowactions>
                                <massactions usefirstitemasdefault="true">
                                    <action type="massupdate"/>
                                </massactions>
                                <views>
                                    <view type="standard"/>
                                </views>
                                <conditions>
                                    <condition type="contextrow" field="Case__c" mergefield="Id" operator="=" fieldtargetobjects="Case"/>
                                </conditions>
                                <searchfields/>
                                <renderconditions logictype="and"/>
                            </skootable>
                        </components>
                    </drawer>
                    <renderconditions logictype="and"/>
                </action>
            </rowactions>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
            </massactions>
            <views>
                <view type="standard"/>
            </views>
            <searchfields/>
            <renderconditions logictype="and"/>
            <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true"/>
        </skootable>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
    <interactions/>
</skuidpage>
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Thank you for taking the time to make a simpler page. I'm looking into it now but I'm being told I have 24 problems with the skuid page because of custom components. This might give me a false positive if I don't see what you're seeing.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Unfortunately, I am still unable to reproduce this problem on my end.
Photo of Matt Small

Matt Small

  • 1,182 Points 1k badge 2x thumb
** Hey, if you have not tried it already, remove the standard cancel / save buttons and make a multiple action button with save model changes and a popup with ui block to say loading. 

Let me know if this doesn't work. 
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb
Part of my lack of urgency is that I'm doing this as a workaround. Shame to lose some of the built-in functionality of the standard save button, I'll repackage this issue when I have a moment and try again.
Photo of Matt Small

Matt Small

  • 1,182 Points 1k badge 2x thumb
Hi David, 

All my builds are now not using the standard save and cancel buttons. After much tinkering on Skuid I have found that the multiple action button adds more flexibility. I have the UI block with message to give the user experience that extra little bit of shine that you don't get straight off the standard built in functionality of the standard save button. 
Photo of Debbie Bishko

Debbie Bishko

  • 250 Points 250 badge 2x thumb
FYI, I am also now seeing this same issue.  One of the features of the standard Save button is that the button greys out when there are no unsaved changes.  To create this feature using custom buttons, I created 2 versions of a custom Save button.  One renders only where there are unsaved changes on one of the models.  The other renders only when there are no unsaved changes on any of the models.  But since this issue has been marked "Solved", I would be curious to know if there was a solution to using the standard Save button.  Thanks.
Photo of Josef Lagorio

Josef Lagorio

  • 2,864 Points 2k badge 2x thumb
I too am experiencing this issue with the "standard" save button. Matt's suggestion of turning it in to a multiple actions button eliminated the perpetual "saving..."