Disassociating Relationship Between Two Records
//disassociatingRelationshipBetweenTwoRecords
function disassociatingRelationship() {
//debugger;
if (confirm("Do You Want To Diassociate Records"))
{
var Id1 = Xrm.Page.getAttribute("nist_lookup").getValue();
var idValue = Id1[0].id;
var Id2 = Xrm.Page.data.entity.getId();
XrmSvcToolkit.disassociate({
entity1Id: idValue,
entity1Name: "Account",
entity2Id: Id2,
entity2Name: "nist_crudexample",
relationshipName: "nist_nist_crudexample_account",
async: false,
successCallback: function () {
alert("The records should be disassociated.");
},
errorCallback: function (error) {
alert(error + "error occured");
}
});
}
}
function disassociatingRelationship() {
//debugger;
if (confirm("Do You Want To Diassociate Records"))
{
var Id1 = Xrm.Page.getAttribute("nist_lookup").getValue();
var idValue = Id1[0].id;
var Id2 = Xrm.Page.data.entity.getId();
XrmSvcToolkit.disassociate({
entity1Id: idValue,
entity1Name: "Account",
entity2Id: Id2,
entity2Name: "nist_crudexample",
relationshipName: "nist_nist_crudexample_account",
async: false,
successCallback: function () {
alert("The records should be disassociated.");
},
errorCallback: function (error) {
alert(error + "error occured");
}
});
}
}
Comments
Post a Comment