Uncaught model... I think I have async problems?

Here's my code.
Thanks!
var model = arguments[0].model, row = arguments[0].row;I'm getting the error, 'uncaught model' on the AllAppoitments model. It looks like the save doesn't complete before the update is attempted. How do I handle that properly?
var mA = skuid.$M('AllAppointments');
mA.createRow({additionalConditions:[
{field: 'Start__c', value: row.Start__c},
{field: 'End__c', value: row.End__c},
{field: 'Room__c', value: row.Room__c}
]});
model.deleteRow(row);
mA.save();
mA.setCondition(mA.getConditionByName('ThisOne'), mA.getFirstRow().Id);
mA.updateData();
Thanks!
3
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
Here's my new code:
But I'm not quite sure how to implement.
It seems like the deferred promise isn't keeping the calendar popup from popping up... https://community.skuidify.com/skuid/topics/calendar-popup-showing-before-deferred-promise-resolved
Can we add this to documentation?
"You'd need to do set a deferred promise if there are other actions following this in an action framework."