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);
}