Attachments table only loading one more record when Load More clicked, but there are more records

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
We have a page that has a tab for related attachments.  There is an action on the tab to query the attachment model.  The model has a limit of 25 and is sorted by CreatedDate DESC.  We have a record with more than 25 attachments (there are 56), but when we click Load More only one more record loads.  If we up the model limit to 30 the same thing happens (it loads 30 and then after clicking Load More only 1 more loads).
Photo of Curtis Ellingham

Curtis Ellingham

  • 362 Points 250 badge 2x thumb
  • Frustrated

Posted 2 years ago

  • 1
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi Curtis


Are your attachments loading from a separate model or the same model you are using for other parts of the page that might be tied to a model action?

Also what Version are you on?



Chat soon.
(Edited)
Photo of Curtis Ellingham

Curtis Ellingham

  • 362 Points 250 badge 2x thumb
They load from a separate model, there is an action on a tab to load the attachments model
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi CurtisI will attempt to regenerate this problem and come back to you soonest.What version are you on?
Photo of Curtis Ellingham

Curtis Ellingham

  • 362 Points 250 badge 2x thumb
9.3
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi Curtis

I am running on 9.3.4 and completed the following test.

I used the case and attachment objects and attached 11 files to a case.

I built a page using detail view to expose the Case.

I added 2 Tabs. 1 for 'more info' which loads first and another for the 'attachments' which only renders on first view with an action which queries the attachment model.

I set the attachment model to only load 5 records and on page load the 'more' prompt appears and when clicked more records are loaded without any strange behaviour.

Update your org to 9.3.4 and cut and past this XML into a new page.  You can then add your current models to the page and remove the case details Ui to test.

Good luck.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">    <models>
        <model id="CasesMod" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Case">
            <fields>
                <field id="Id"/>
                <field id="CaseNumber"/>
                <field id="AccountId"/>
                <field id="Account.Name"/>
                <field id="Type"/>
                <field id="Account.AccountNumber"/>
                <field id="Account.Rating"/>
                <field id="Origin"/>
                <field id="Reason"/>
                <field id="ContactEmail"/>
                <field id="ContactFax"/>
                <field id="ContactMobile"/>
                <field id="ContactPhone"/>
                <field id="IsEscalated"/>
            </fields>
            <conditions>
                <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior="" state=""/>
            </conditions>
            <actions/>
        </model>
        <model id="AttachModel1" limit="5" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Attachment">
            <fields>
                <field id="Id"/>
                <field id="Name"/>
                <field id="ParentId"/>
                <field id="Parent.Name"/>
            </fields>
            <conditions>
                <condition type="param" value="id" field="ParentId" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="CasesMod" buttonposition="" uniqueid="sk-3umxv0-254" mode="read">
            <columns>
                <column width="50%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field id="Account.Name"/>
                                <field id="Account.AccountNumber"/>
                                <field id="Account.Rating"/>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Section B" collapsible="no">
                            <fields>
                                <field id="CaseNumber"/>
                                <field id="Type"/>
                            </fields>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
        <tabset rememberlastusertab="true" defertabrendering="true" uniqueid="sk-3unIYh-297" renderas="">
            <tabs>
                <tab name="More" loadlazypanels="true" icon="fa-bank">
                    <components>
                        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="CasesMod" buttonposition="" uniqueid="sk-3unt_m-324" mode="read">
                            <columns>
                                <column width="50%">
                                    <sections>
                                        <section title="Section A" collapsible="no">
                                            <fields>
                                                <field id="Origin"/>
                                                <field id="Reason"/>
                                                <field id="ContactEmail"/>
                                                <field id="ContactFax"/>
                                            </fields>
                                        </section>
                                    </sections>
                                </column>
                                <column width="50%">
                                    <sections>
                                        <section title="Section B" collapsible="no">
                                            <fields>
                                                <field id="ContactMobile"/>
                                                <field id="ContactPhone"/>
                                                <field id="IsEscalated"/>
                                            </fields>
                                        </section>
                                    </sections>
                                </column>
                            </columns>
                        </basicfieldeditor>
                    </components>
                </tab>
                <tab name="Attachments" icon="sk-icon-attachments">
                    <components>
                        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="5" createrecords="true" model="AttachModel1" buttonposition="" mode="read" allowcolumnreordering="true" uniqueid="sk-3uRmK6-205">
                            <fields>
                                <field id="Id" hideable="true" uniqueid="fi-3uRqoZ-227"/>
                                <field id="Name" hideable="true" uniqueid="fi-3uRqoZ-228"/>
                                <field id="ParentId" hideable="true" uniqueid="fi-3uRqoZ-229"/>
                            </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>
                    <oninitialshowactions>
                        <action type="requeryModels" behavior="standard">
                            <models>
                                <model>AttachModel1</model>
                            </models>
                        </action>
                    </oninitialshowactions>
                    <onshowactions/>
                </tab>
            </tabs>
        </tabset>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>