In this function i want to create record of department against School (School (1): Depattment(N))
function CreateRecord()
{
var stdId = Xrm.Page.data.entity.getId();
var entity = {};
entity.new_School = {
Id: stdId,
LogicalName: "new_department"//logical name of entity if which you want to create record
};
entity.new_name = "test";
XrmServiceToolkit.Rest.Create(
entity,
"new_departmentSet",//
function (result) {
var newEntityId = result.new_departmentId;
},
function (error) {
alert(error.message);
},
true
);
}
function CreateRecord()
{
var stdId = Xrm.Page.data.entity.getId();
var entity = {};
entity.new_School = {
Id: stdId,
LogicalName: "new_department"//logical name of entity if which you want to create record
};
entity.new_name = "test";
XrmServiceToolkit.Rest.Create(
entity,
"new_departmentSet",//
function (result) {
var newEntityId = result.new_departmentId;
},
function (error) {
alert(error.message);
},
true
);
}
No comments:
Post a Comment