AnsweredAssumed Answered

app.api.call vs fetch()

Question asked by Jeff Bickart on Dec 16, 2015
Latest reply on Apr 21, 2016 by Matt Marum

What is the optimal way to get data in a Dashlet, record.js, create-actions.js etc...

 

 

var self = this;
app.api.call('GET', app.api.buildURL('Contacts/abc'), null, {
   success: function (data) {
   console.log(data);
  }
});

 

or

 

var parentRecord = app.data.createBean('Contacts', {id:  'abc'});
parentRecord.fetch({
   success: function(data) {
    console.log(data);
  }
});

Outcomes