Get data from a Drawer

If I have something like this in my record.js, the module is Notes

app.drawer.open({
     layout: 'create',
     context: {
          create: true,
          module: linkModule,
          recParentModel: parentModel,
          model: prefill,
          recLink: link,
          recContext: this.context,
          recView: this.view
                              }
     }, _.bind(function (model) {
          //get data from model here
        }

is there a way to get the savd note ID and DESCRIPTION from 'model'?  I have tried everything I know and I cant seem to get back to the record that was created from the opened drawer.

Parents Reply Children
  • It does return the model but I cant get any data for example none of these return anything

    }, _.bind(function (model) {
         console.log(model.get('id'));
         console.log(model.get('description'));
         console.log(model.id);
         console.log(model.description);
         console.log(this.model.get('id'));
         console.log(this.model.get('description'));
    }, this));
  • I figured it out

    app.drawer.open(
    {
         layout: 'create',
         context: {
              create: true,
              module: linkModule,
              recParentModel: parentModel,
                 model: prefill,
              recLink: link,
              recContext: this.context,
              recView: this.view
         }
    }, _.bind(function (context, newModel) {
         console.log(newModel.get('id'));
         console.log(newModel.get('description'));
    }}, this);

    I did that by hand so I might not have the right number of braces but you get the jist.