For anyone else wondering how to do this, here is the current best practice using AutoForm to use the same form for insert and update.
First, add your form and set the doc and type as helper variables that you can manipulate.
{{> quickForm collection="Schedules" id="scheduleForm" doc=currentSchedule type=formType}}
Set your formType as either a reactive-var (better) or Session variable with a default value of “insert”
Template.schedule.onCreated(function(){
this.formType = new ReactiveVar( 'insert' );
});
Next, set up helpers for both the current doc and formType. This checks for a current document, and if it exists, updates the form to an “update” type and provides the document to update. The formType helper just fetches the current formType value.
Template.schedule.helpers({
currentSchedule: function() {
var currentSchedule = Schedules.findOne({ campaignId: FlowRouter.getParam('campaignId') });
if (currentSchedule) {
Template.instance().formType.set('update');
return currentSchedule;
}
},
formType: function() {
var formType = Template.instance().formType.get();
return formType;
}
});