Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

N:N Record Association with SDK REST JS

$
0
0

I am trying to use below code for association but getting the error as "errorHandler" is undefined and where can see the associated records in cRM.

var MainClientlookupObj = Xrm.Page.getAttribute("primarycontactid"); //Check for Lookup Object
if (MainClientlookupObj != null) {
var lookupObjValue = MainClientlookupObj.getValue();//Check for Lookup Value
if (lookupObjValue != null) {
var lookupEntityType = lookupObjValue[0].entityType, //To get EntityName
lookupRecordGuid = lookupObjValue[0].id, // To get record GUID
lookupRecordName = lookupObjValue[0].name; //To get record Name
var Companyid = Xrm.Page.data.entity.getId();
SDK.REST.associateRecords(Companyid, "account", "new_contact_other_business", lookupRecordGuid, "contact", function () {//if (alertFlag.checked == true)
//alert("Association successful.");
},
errorHandler);
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>