Newer Version Available
Creating Records with
Create a record by calling create() on a Remote
Objects model instance.
create() accepts two
arguments, both optional.
The field_values block
enables you to define and create a record in one statement. Set field
values as you do when you create a model, using a JSON string. For
example, the following two calls to create() are equivalent.
create() doesn’t return a result directly. The callback
function enables you to handle the server response asynchronously.
Your callback function can accept up to three
arguments.
See
Callback Functions Callback Functions for details about writing Remote Objects callback functions.
The Id field is set on the Remote Object as part of a
successful create() call. You can access this
field in your callback
function.
Note the use of the log() function;
it’s the equivalent of toString() for Remote
Objects.