According to the documentation, new records can be inserted into a datasource like this:
var record = app.models.Person.newRecord();
app.saveRecords([record]);
However, when in my server script I'm trying to do something as simple as:
var item = app.models.ScheduledTournaments.newRecord()
...I'm getting this in return:
TypeError: [object Object] is not a function, it is object. at SharkScope:125 at scheduledTournaments (SharkScope:122)
So it appears that newRecord
is not a function at all. Why? And how do you access datasources from a server script?