Kendo dataSource.add - "Id is not defined"
<p>I'm trying to add some items to a Kendo DataSource to then display in the grid. However, every time I try to save I get <code>Reference Error: Id is not defined</code>.</p>

<p>At first I thought it was because I didn't include <code>Id</code> in my schema but I checked and it looks alright.</p>

<pre><code>var viewModel = new kendo.observable({
orgDataSource: new kendo.data.DataSource({
    transport: {
        read: {
            url: "/Organization/GetAll",
            dataType: "json"
        },
        update: {
            url: "/Host/Organization/Edit",
            dataType: "json",
            type: "POST",
            data: {
                __RequestVerificationToken: getAntiForgeryToken()
            }
        },
        create: {
            url: "/Host/Organization/Create",
            dataType: "json",
            type: "POST",
            data: {
                __RequestVerificationToken: getAntiForgeryToken()
            }
        },
        destroy: {
            url: "/Host/Organization/Delete",
            dataType: "json",
            type: "POST",
            data: {
                __RequestVerificationToken: getAntiForgeryToken()
            }
        }
    },
    schema: {
        model: {
            id: "Id",
            fields: {
                Id: { type: "number", editable: false, nullable: true },
                Name: { type: "string" },
                LicenseExpiration: { type: "date" },
                LicenseNumber: { type: "number" },
                Active: { type: "boolean" },
                CreateDate: { type: "date" },
                LastModDate: { type: "date" },
                AvailableLicenses: { type: "string" },
                State: { type: "string" }
            }
        },
        errors: "errorMsg"
    },
    pageSize: 20,
    error: function (e) {
        toastr.options = {
            "positionClass": "toast-bottom-full-width"
        };
        toastr.error("There was an error: " + e.errors, "Uh, Oh!");
        this.cancelChanges();
    },
    serverPaging: false,
    serverFiltering: false,
    serverSorting: false
}),
reloadOrganizations: function () {
    this.get("orgDataSource").read();
},
onOrgSave: function (e)
{
    var uid = $('input[name="OrgRowUID"]').val();
    var tr = $('tr[data-uid="' + uid + '"]'); // get the current table row (tr)
    var name = $('input[name="Name"]').val();
    var licenseNumber = $('input[name="LicenseNumber"]').val();
    var licenseExpiration = $('input[name="LicenseExpiration"]').val();
    var email = $('input[name="Email"]').val();
    var state = $('input[name="State"]').val();
    var logo = $('input[name="ImageUrl]').val();
    var active = $('input[name="Active"]').is(":checked");

    // get the data bound to the current table row
    var orgGrid = $("#OrganizationGrid").data("kendoGrid");
    var data = orgGrid.dataItem(tr);

    if (data == null)
    {
        viewModel.orgDataSource.add({ Name: name, LicenseNumber: licenseNumber, LicenseExpiration: licenseExpiration, Email: email, State: state, ImageUrl: logo, Active: active })
        orgGrid.saveChanges();
        viewModel.orgDataSource.sync();
        viewModel.reloadOrganizations();
    } else {
        data.set("Name", name);
        data.set("LicenseNumber", licenseNumber);
        data.set("LicenseExpiration", licenseExpiration);
        data.set("Email", email);
        data.set("State", state);
        data.set("ImageUrl", logo);
        data.set("Active", active);
    }

    $("#orgCreateModal").modal('hide');
    $("#orgEditModal").modal('hide');
}
});
</code></pre>

<p>The error is occurring on this line:</p>

<pre><code>viewModel.orgDataSource.add({ Name: name, LicenseNumber: licenseNumber, LicenseExpiration: licenseExpiration, Email: email, State: state, ImageUrl: logo, Active: active });
</code></pre>

<p>The error in FireBug is:</p>

<blockquote>
  <p>Reference Error: Id is not defined - kendo.all.min.js line 25 > function</p>
</blockquote>