PDA

View Full Version : form.updateRecord() vs. form.getRecord()



estesbubba
23 Mar 2012, 7:53 AM
Converting app from 1.1 to 2.0 and we use form.loadRecord(model) which is now deprecated so I switched to form.setRecord(model) and it works just fine. So I figured instead of using form.updateRecord(model) to now use model = form.getRecord(). form.getRecord() returns the original record and not one with the new data the user entered into the form. form.updateRecord(model) works but doesn't even show in the API docs.

So how is model data supposed to be passed in and out of forms?

mitchellsimoens
23 Mar 2012, 9:17 AM
setRecord to set the record onto the form which will set the values on the fields. updateRecord will take the values from the fields and set it on the record that was passed in to it. getRecord will simply return the record that was passed in with setRecord.