Skip to main content

Hi, 

In earlier versions of Skuid, before 9.5, I could update fields in a UI Only model via a snippet. I could update fields in a snippet via the same updateRow function that we use for regular saleforce models. Now, and I’ve tried in both 9.5.12 and 10.0.4, I can no longer do this.  Here is a bit of the code that makes a new row in the UI only model (ConfigKitGroup1SelectorUI) and update the filed counter on it. 

var $ = skuid.$;
var models = skuid.model.map();
var UISelectors = models.ConfigKitGroup1SelectorUI;

var Qty = 5
var count = 1;

while (Qty > 0){
    console.log(‘Adding Row to Group 1’);
    var newRow = UISelectors.createRow({doAppend : true});
    UISelectors.updateRow(
    { Id: newRow.Id },
   {
        Counter: count
    }
    );
    Qty–;
    count++;
}


When running this it makes the rows, but doesn’t update the counter field with the value. I’ve worked around this issue with a simple index reference but I’m wondering why I can no longer do something like this.


Andy

Andy,

Try the field updates as a single object in the first argument of the updateRow() call, like so:


UISelectors.updateRow({ <br>&nbsp; &nbsp; &nbsp; &nbsp; Id: newRow.Id,<br>&nbsp; &nbsp; &nbsp; &nbsp; Counter: count<br>&nbsp; &nbsp; });

Reply