I have a simple page with two account models on it. One is used for the list view, the other is used to create a record. The list view model (loaded on page load) has 8 fields and 1 condition. It takes more than 30 seconds to load, and chrome keeps killing it. I’ve tried to limit the model returns to 100 records, but it still takes more than 30 seconds to load. Any direction on what to do would be appreciated.
Strange. Standard object?
Either way, can you provide the XML?
Standard Account Object, here’s the XML: Vendor Accounts Home VendorAccounts Create new Vendor{{#Name}}: {{Name}}{{/Name}} Vendor: var $ = skuid.$, params = argumentst0], component = params.component, popup = component.editor.element.closest(‘.ui-dialog-content’), modelsToSave = , objLabelsToSave = , uniqueModels = {}; popup.children().each(function(){ var obj = $(this).data(‘object’); if (obj && obj.model && !uniqueModelsiobj.model.id]) { var model = obj.model; modelsToSave.push(model); if (model.data && model.data.length) { if (model.data.length>1) { objLabelsToSave.push(model.labelPlural); } else { objLabelsToSave.push(model.label); } } uniqueModelsiobj.model.id] = 1; } }); var message = 'Saving new ‘; if (objLabelsToSave.length < 3) { message += objLabelsToSave.join(’ and ‘); } else { var lastObj = objLabelsToSave.pop(); message += objLabelsToSave.join(’, '); message += ', and ’ + lastObj; } message += ‘…’; popup.block({ message: message }); skuid.model.save(modelsToSave,{callback:function(result){ if (result.totalsuccess){ // Refresh the data in related Models on the page var uniqueRelatedObjectsToCheck = {}, relatedModelsToUpdate = ; $.each(modelsToSave,function(){ if (this.objectName && !uniqueRelatedObjectsToChecknthis.objectName]) { uniqueRelatedObjectsToChecknthis.objectName] = 1; } }); // Loop over all Models, // including the Models we’ve already saved, // and find ones that are on the same objects as the ones we’ve already saved. // Update them if they do not have unsaved changes. $.each(skuid.model.list(),function(){ if (uniqueRelatedObjectsToCheckfthis.objectName] && !this.hasChanged) { relatedModelsToUpdate.push(this); } }); $.when(skuid.model.updateData(relatedModelsToUpdate)).then(function(){ $.each(popup.children(),function(){ var obj = $(this).data(‘component’); if (obj && obj.unregister) obj.unregister(); }); popup.dialog(‘destroy’); // Create new Rows in our Models to Save, // to prepare for the NEXT time someone creates a new record $.each(modelsToSave,function(){ this.createRow(); }); }); } else { popup.unblock(); } }});
Meant this.
Weird. I only see the option to upload an image.
Hi,
In case you have 1 model condition based on another model that is returning no row, see this post
https://community.skuid.com/t/page-load-very-slow-if-no-records-found-or-no-record-meet-d…
Strange. Which browser are you using? Have you tried other browsers in to post in the community?
Strange, I was in Chrome and it wasn’t working. Here it is:
<skuidpage unsavedchangeswarning="yes">
<models>
<model id="VendorAccounts" limit="100" query="true" createrowifnonefound="false" adapter="" type="" sobject="Account" orderby="Name" doclone="">
<fields>
<field id="Name"/>
<field id="Type_of_Company__c"/>
<field id="Total_Clients__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="NDA_Type__c"/>
<field id="Vendor_Note__c"/>
<field id="CIK__c"/>
</fields>
<conditions>
<condition type="multiple" field="Type_of_Company__c" operator="in" inactive="true" enclosevalueinquotes="true" name="__autofilter__Type_of_Company__c" state="filterableoff" value=""/>
<condition type="fieldvalue" field="NDA_Type__c" operator="=" inactive="true" enclosevalueinquotes="true" name="__autofilter__NDA_Type__c" state="filterableoff" value=""/>
<condition type="multiple" field="BCP_Type__c" operator="in" inactive="true" enclosevalueinquotes="true" name="__autofilter__BCP_Type__c" state="filterableoff" value=""/>
<condition type="fieldvalue" value="Client Vendor" enclosevalueinquotes="true" field="Type" operator="="/>
</conditions>
<actions/>
</model>
<model id="CreateVendor" limit="0" query="false" createrowifnonefound="true" adapter="" type="" sobject="Account" doclone="">
<fields>
<field id="Name"/>
<field id="ParentId"/>
<field id="Parent.Name"/>
<field id="Type"/>
<field id="Type_of_Company__c"/>
<field id="CIK__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="Permission_to_Share_All__c"/>
<field id="Vendor_Note__c"/>
<field id="Industry"/>
<field id="NDA_Required__c"/>
<field id="Who_Signs__c"/>
<field id="NDA_Note__c"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<pageregioncontents>
<pageregioncontent regionid="sk-3szsUx-151" uniqueid="sk-C5xj-103">
<components>
<pagetitle uniqueid="sk-CBL5-121" model="CurrentUser">
<maintitle>Vendor Accounts</maintitle>
<subtitle>Home</subtitle>
<actions>
<action type="savecancel" window="self">
<models>
<model>VendorAccounts</model>
</models>
</action>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="true" pagesize="50" createrecords="false" model="VendorAccounts" buttonposition="" mode="read" uniqueid="sk-CPb8-155" emptysearchbehavior="query" allowscrollbars="true" floatheader="true" searchplaceholdertext="Search Vendors">
<fields>
<field id="Name" valuehalign="" type="" allowordering="true"/>
<field id="Type_of_Company__c" valuehalign="" type="" allowordering="true"/>
<field id="Total_Clients__c" decimalplaces="" valuehalign="" type="" allowordering="true">
<summaries/>
</field>
<field id="FY_End__c" valuehalign="" type="" allowordering="true"/>
<field id="BCP_Type__c" valuehalign="" type="" allowordering="true"/>
<field id="NDA_Type__c" valuehalign="" type="" allowordering="true"/>
<field id="Vendor_Note__c"/>
<field id="CIK__c" valuehalign="" type=""/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="redirect" label="Open" icon="sk-icon-add-reference" window="self" url="/{{Id}}"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
<exportproperties usetablecolumns="true" loadallrecords="true"/>
<filters>
<filter type="multiselect" filteroffoptionlabel="All Company Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="Type_of_Company__c" conditionoperator="in"/>
<filter type="select" filteroffoptionlabel="All NDA Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="NDA_Type__c"/>
<filter type="multiselect" filteroffoptionlabel="All BCP Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="BCP_Type__c" conditionoperator="in"/>
<filter type="toggle" filteroffoptionlabel="New Filter" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" labelmode="auto" label="Include Inactive">
<effects>
<effect action="deactivate" value="" condition="Total_Clients__c"/>
</effects>
</filter>
</filters>
<searchfields usesosl="true" soslfields="Name Fields"/>
<actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
<action type="popup" label="Create New Vendor" icon="sk-icon-add">
<popup title="Create New Vendor" width="80%">
<components>
<pagetitle model="CreateVendor" uniqueid="sk-IxeT-327">
<maintitle>Create new Vendor{{#Name}}: {{Name}}{{/Name}}</maintitle>
<subtitle>Vendor:</subtitle>
<actions>
<action type="custom" label="Save" icon="sk-icon-save" snippet="saveNewItemsInPopup"/>
</actions>
</pagetitle>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="CreateVendor" buttonposition="" uniqueid="sk-J4u4-334" mode="edit" layout="">
<columns layoutmode="fixed">
<column width="50%">
<sections>
<section title="Vendor Information" collapsible="no">
<fields>
<field id="Name"/>
<field id="ParentId"/>
<field id="Type"/>
<field id="Type_of_Company__c"/>
<field id="CIK__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="Permission_to_Share_All__c"/>
<field id="Vendor_Note__c"/>
<field id="Industry"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="NDA Details" collapsible="no">
<fields>
<field id="NDA_Required__c"/>
<field id="Who_Signs__c"/>
<field id="NDA_Note__c"/>
</fields>
</section>
</sections>
</column>
</columns>
<renderconditions logictype="and"/>
<conditions/>
</basicfieldeditor>
</components>
</popup>
</action>
</actions>
</skootable>
</components>
</pageregioncontent>
</pageregioncontents>
<components/>
<resources>
<labels/>
<css/>
<javascript>
<jsitem location="inlinesnippet" name="saveNewItemsInPopup" cachelocation="false">var $ = skuid.$,
params = argumentst0],
component = params.component,
popup = component.editor.element.closest('.ui-dialog-content'),
modelsToSave = ,
objLabelsToSave = ,
uniqueModels = {};```popup.children().each(function(){
var obj = $(this).data('object');
if (obj &amp;&amp; obj.model &amp;&amp; !uniqueModelslobj.model.id]) {
var model = obj.model;
modelsToSave.push(model);
if (model.data &amp;&amp; model.data.length) {
if (model.data.length&gt;1) {
objLabelsToSave.push(model.labelPlural);
} else {
objLabelsToSave.push(model.label);
}
}
uniqueModelslobj.model.id] = 1;
}
});
var message = 'Saving new ';
if (objLabelsToSave.length &lt; 3) {
message += objLabelsToSave.join(' and ');
} else {
var lastObj = objLabelsToSave.pop();
message += objLabelsToSave.join(', ');
message += ', and ' + lastObj;
}
message += '...';
popup.block({
message: message
});
skuid.model.save(modelsToSave,{callback:function(result){
if (result.totalsuccess){
// Refresh the data in related Models on the page
var uniqueRelatedObjectsToCheck = {},
relatedModelsToUpdate = =];
$.each(modelsToSave,function(){
if (this.objectName &amp;&amp; !uniqueRelatedObjectsToCheckcthis.objectName]) {
uniqueRelatedObjectsToCheckcthis.objectName] = 1;
}
});
// Loop over all Models,
// including the Models we've already saved,
// and find ones that are on the same objects as the ones we've already saved.
// Update them if they do not have unsaved changes.
$.each(skuid.model.list(),function(){
if (uniqueRelatedObjectsToCheckcthis.objectName]
&amp;&amp; !this.hasChanged) {
relatedModelsToUpdate.push(this);
}
});
$.when(skuid.model.updateData(relatedModelsToUpdate)).then(function(){
$.each(popup.children(),function(){
var obj = $(this).data('component');
if (obj &amp;&amp; obj.unregister) obj.unregister();
});
popup.dialog('destroy');
// Create new Rows in our Models to Save,
// to prepare for the NEXT time someone creates a new record
$.each(modelsToSave,function(){
this.createRow();
});
});
} else {
popup.unblock();
}
}});</jsitem>
</javascript>
</resources>
</skuidpage>
<skuidpage unsavedchangeswarning="yes">
<models>
<model id="VendorAccounts" limit="100" query="true" createrowifnonefound="false" adapter="" type="" sobject="Account" orderby="Name" doclone="">
<fields>
<field id="Name"/>
<field id="Type_of_Company__c"/>
<field id="Total_Clients__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="NDA_Type__c"/>
<field id="Vendor_Note__c"/>
<field id="CIK__c"/>
</fields>
<conditions>
<condition type="multiple" field="Type_of_Company__c" operator="in" inactive="true" enclosevalueinquotes="true" name="__autofilter__Type_of_Company__c" state="filterableoff" value=""/>
<condition type="fieldvalue" field="NDA_Type__c" operator="=" inactive="true" enclosevalueinquotes="true" name="__autofilter__NDA_Type__c" state="filterableoff" value=""/>
<condition type="multiple" field="BCP_Type__c" operator="in" inactive="true" enclosevalueinquotes="true" name="__autofilter__BCP_Type__c" state="filterableoff" value=""/>
<condition type="fieldvalue" value="Client Vendor" enclosevalueinquotes="true" field="Type" operator="="/>
</conditions>
<actions/>
</model>
<model id="CreateVendor" limit="0" query="false" createrowifnonefound="true" adapter="" type="" sobject="Account" doclone="">
<fields>
<field id="Name"/>
<field id="ParentId"/>
<field id="Parent.Name"/>
<field id="Type"/>
<field id="Type_of_Company__c"/>
<field id="CIK__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="Permission_to_Share_All__c"/>
<field id="Vendor_Note__c"/>
<field id="Industry"/>
<field id="NDA_Required__c"/>
<field id="Who_Signs__c"/>
<field id="NDA_Note__c"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<pageregioncontents>
<pageregioncontent regionid="sk-3szsUx-151" uniqueid="sk-C5xj-103">
<components>
<pagetitle uniqueid="sk-CBL5-121" model="CurrentUser">
<maintitle>Vendor Accounts</maintitle>
<subtitle>Home</subtitle>
<actions>
<action type="savecancel" window="self">
<models>
<model>VendorAccounts</model>
</models>
</action>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="true" pagesize="50" createrecords="false" model="VendorAccounts" buttonposition="" mode="read" uniqueid="sk-CPb8-155" emptysearchbehavior="query" allowscrollbars="true" floatheader="true" searchplaceholdertext="Search Vendors">
<fields>
<field id="Name" valuehalign="" type="" allowordering="true"/>
<field id="Type_of_Company__c" valuehalign="" type="" allowordering="true"/>
<field id="Total_Clients__c" decimalplaces="" valuehalign="" type="" allowordering="true">
<summaries/>
</field>
<field id="FY_End__c" valuehalign="" type="" allowordering="true"/>
<field id="BCP_Type__c" valuehalign="" type="" allowordering="true"/>
<field id="NDA_Type__c" valuehalign="" type="" allowordering="true"/>
<field id="Vendor_Note__c"/>
<field id="CIK__c" valuehalign="" type=""/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="redirect" label="Open" icon="sk-icon-add-reference" window="self" url="/{{Id}}"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
<exportproperties usetablecolumns="true" loadallrecords="true"/>
<filters>
<filter type="multiselect" filteroffoptionlabel="All Company Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="Type_of_Company__c" conditionoperator="in"/>
<filter type="select" filteroffoptionlabel="All NDA Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="NDA_Type__c"/>
<filter type="multiselect" filteroffoptionlabel="All BCP Types" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="no" conditionfield="BCP_Type__c" conditionoperator="in"/>
<filter type="toggle" filteroffoptionlabel="New Filter" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" labelmode="auto" label="Include Inactive">
<effects>
<effect action="deactivate" value="" condition="Total_Clients__c"/>
</effects>
</filter>
</filters>
<searchfields usesosl="true" soslfields="Name Fields"/>
<actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
<action type="popup" label="Create New Vendor" icon="sk-icon-add">
<popup title="Create New Vendor" width="80%">
<components>
<pagetitle model="CreateVendor" uniqueid="sk-IxeT-327">
<maintitle>Create new Vendor{{#Name}}: {{Name}}{{/Name}}</maintitle>
<subtitle>Vendor:</subtitle>
<actions>
<action type="custom" label="Save" icon="sk-icon-save" snippet="saveNewItemsInPopup"/>
</actions>
</pagetitle>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="CreateVendor" buttonposition="" uniqueid="sk-J4u4-334" mode="edit" layout="">
<columns layoutmode="fixed">
<column width="50%">
<sections>
<section title="Vendor Information" collapsible="no">
<fields>
<field id="Name"/>
<field id="ParentId"/>
<field id="Type"/>
<field id="Type_of_Company__c"/>
<field id="CIK__c"/>
<field id="FY_End__c"/>
<field id="BCP_Type__c"/>
<field id="Permission_to_Share_All__c"/>
<field id="Vendor_Note__c"/>
<field id="Industry"/>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="NDA Details" collapsible="no">
<fields>
<field id="NDA_Required__c"/>
<field id="Who_Signs__c"/>
<field id="NDA_Note__c"/>
</fields>
</section>
</sections>
</column>
</columns>
<renderconditions logictype="and"/>
<conditions/>
</basicfieldeditor>
</components>
</popup>
</action>
</actions>
</skootable>
</components>
</pageregioncontent>
</pageregioncontents>
<components/>
<resources>
<labels/>
<css/>
<javascript>
<jsitem location="inlinesnippet" name="saveNewItemsInPopup" cachelocation="false">var $ = skuid.$,
params = arguments[0],
component = params.component,
popup = component.editor.element.closest('.ui-dialog-content'),
modelsToSave = [],
objLabelsToSave = [],
uniqueModels = {};
popup.children().each(function(){
var obj = $(this).data('object');
if (obj &amp;&amp; obj.model &amp;&amp; !uniqueModels[obj.model.id]) {
var model = obj.model;
modelsToSave.push(model);
if (model.data &amp;&amp; model.data.length) {
if (model.data.length&gt;1) {
objLabelsToSave.push(model.labelPlural);
} else {
objLabelsToSave.push(model.label);
}
}
uniqueModels[obj.model.id] = 1;
}
});
var message = 'Saving new ';
if (objLabelsToSave.length &lt; 3) {
message += objLabelsToSave.join(' and ');
} else {
var lastObj = objLabelsToSave.pop();
message += objLabelsToSave.join(', ');
message += ', and ' + lastObj;
}
message += '...';
popup.block({
message: message
});
skuid.model.save(modelsToSave,{callback:function(result){
if (result.totalsuccess){
// Refresh the data in related Models on the page
var uniqueRelatedObjectsToCheck = {},
relatedModelsToUpdate = [];
$.each(modelsToSave,function(){
if (this.objectName &amp;&amp; !uniqueRelatedObjectsToCheck[this.objectName]) {
uniqueRelatedObjectsToCheck[this.objectName] = 1;
}
});
// Loop over all Models,
// including the Models we've already saved,
// and find ones that are on the same objects as the ones we've already saved.
// Update them if they do not have unsaved changes.
$.each(skuid.model.list(),function(){
if (uniqueRelatedObjectsToCheck[this.objectName]
&amp;&amp; !this.hasChanged) {
relatedModelsToUpdate.push(this);
}
});
$.when(skuid.model.updateData(relatedModelsToUpdate)).then(function(){
$.each(popup.children(),function(){
var obj = $(this).data('component');
if (obj &amp;&amp; obj.unregister) obj.unregister();
});
popup.dialog('destroy');
// Create new Rows in our Models to Save,
// to prepare for the NEXT time someone creates a new record
$.each(modelsToSave,function(){
this.createRow();
});
});
} else {
popup.unblock();
}
}});</jsitem>
</javascript>
</resources>
</skuidpage>
In this case, it's just a basic condition. It's not based on any other models.
So I’ve loaded you’re page into my org. After removing your custom fields I have no issue loading the page.
Few questions:
- What version of Skuid are you running?
- Does it load slowly in another browser?
- Do other pages load quickly?
- Are you getting any errors in the console?
It looks like I’m getting the following error: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/. 155skuid__SkuidJS:23 Refused to set unsafe header “User-Agent”
Those errors shouldn’t slow your page load.
Is there anything you can say about these questions.
- What version of Skuid are you running?
- Does it load slowly in another browser?
- Do other pages load quickly?
- Are you getting any errors in the console?
- I’m on 7.27 2. It runs just as slow in IE 3. Every page loads quickly (under 5 seconds). The two that take the longest are on the account object, and both of them have this error 4. The only error I’m getting is the above “skuid__SkuidJS:23 Refused to set unsafe header “User-Agent””
Ok. You can upgrade to 7.36.
Also, how many Accounts do you have in your org?
Thanks for all your help on this. I went ahead and upgraded to 7.36, and am still receiving the errors, and page load is still over 30 seconds. There are 4,050 in our Sandbox.
I’m stumped.
I’m at a loss here. I’ve just re-verified that it only occurs on the two pages where I have a model based on the account object. Also, I created a completely new page with one account model, that is not assigned as a child page. And received the attached error.
If you kill your javascript does that improve things?
Have you looked at the performance tuning guide? It shows you have to look deeply at what is happening in the salesforce developer console.
http://help.skuid.com/m/supercharge-your-ui/l/391568-skuid-page-performance-guide
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.