 
     Form.created = ->
       @settings = @data.settings ? {}
-      @docs = Form.parseDocs()
-      @data.doc = Form.getValues()
-      @origDoc = Setter.clone(@data.doc)
+      Form.setUpDocs(@)
       @isSubmitting = false
       formArgs.onCreate?.apply(@, arguments)
 
     Form.rendered = ->
-      console.debug 'Rendered form', @, arguments
       # Move the buttons to the same level as the title and content to allow using flex-layout.
       $buttons = @$('.crud.buttons')
       $crudForm = @$('.flex-panel:first')

      hasDoc: -> Form.hasDoc()
      isBulk: -> Form.isBulk()
      autosave: -> formArgs.autosave
      resetOnSuccess: -> formArgs.resetOnSuccess

    ################################################################################################
    # EVENTS

    # AUXILIARY
    ################################################################################################

    Form.setUpDocs = (template) ->
      template = getTemplate(template)
      data = template.data
      template.docs = Form.parseDocs(template)
      data.doc = Form.getValues(template)
      template.origDoc = Setter.clone(data.doc)

    Form.updateDocs = (template) ->
      template = getTemplate(template)
      data = template.data
      docs = _.map template.docs, (doc) -> Form.getCollection().findOne(doc._id)
      template.docs = docs
      data.doc = Form.getValues(template)
      if data.docs?
        data.docs = docs

    Form.parseDocs = (template) ->
      template = getTemplate(template)
      data = template.data
