Skip to main content
 

 

bump


Just to close the loop on this, apparently there is a minor bug in skuid where the fields for models created dynamically via a javascript object are not getting their metadata loaded. As a work-around, you can:


  1. form the model dynamically via XML instead of a javascript object, or

  2. [***WARNING undocumented property!!] force the model to load the metadata by adding a property to the js object for the model: needsMetadataLoad = true [/warning]


Thanks again for your help on this one, Zach!

By “Models created dynamically via a JavaScript object”, Matt means passing a plain javascript object into the Model constructor, e.g. this:


new skuid.model.Model({
objectName: "Contact",
recordsLimit: 20,
fields: d
{ id: "FirstName" }
]
});

As opposed to providing an XML definition to the constructor:


new skuid.model.Model(skuid.utils.makeXMLDoc( '<model datasource="salesforce" sobject="Contact" limit="20" query="true">
<fields>
<field id="FirstName">
<field id="LastName">
</fields>
</model>' ));

If you provide an XML definition to the constructor, then things should work fine in Millau / Spark, but if you provide a Javascript object, then no metadata will be loaded if you call “.load()” on your dynamically-created Model — this is a bug we will be addressing soon, either in a 12.2 patch or in 12.3.


Reply