How does Skuid persist objects to SF?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
I'm writing a snippet that programmatically adds blank lines to tables (whose models are child objects) when the user tabs through the table. I have to add and remove values from the changes object, which is fine.

The code is working for modifying and deleting an object, but not for adding a new object. The new object never appears in SalesForce. I'm under the impression that Skuid persists all the changes to the requested model after calling model.save(). Furthermore, I've found that I need to specify the id of the parent object in the object definition of the child models being saved, but even after doing so, they still don't appear in SalesForce. Is there something I'm missing?
Photo of Robert Mruczek

Robert Mruczek

  • 222 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Hi Robert,

Our supported way for:
 - creating new rows in Models is to use model.createRow()
 - updating existing rows is to use model.updateRow(row,field,newValue)
 - marking records for deletion is to use model.deleteRow(row)
 - commit all changes to salesforce (as you've seen) is model.save()

where model is an instance of a Skuid model such as is retrieved by skuid.model.getModel(modelId) and row is a data row retrieved from a model via model.getRowById(rowId) or by grabbing a row from model.data 

These methods are covered in more detail in our API docs on the skuid Model object.

Hope that helps!

Zach