I am getting error, that my JS is not loaded:
This function is not being loaded on the page, as you can see error message. I am having difficulty to understand, why my JS is not being loaded:
function filterleadContacts() {
debugger;
var LeadId = Xrm.Page.getAttribute("seda_lead").getValue();
alert(LeadId);
//filter LookUp BoothService
if (IsFieldExistsOnForm("seda_lead")) {
if (!IsLookUpEmpty("seda_lead")) {
EnableField("primarycontactid");
Xrm.Page.getControl("primarycontactid").addPreSearch(function () {
addLeadCustomFilterLookUp(LeadId);
}
);
}
}
else { HideField("primarycontactid"); }
}
// Method Description: Filter Function attached to filterBoothServices function
function addLeadCustomFilterLookUp(param_LeadId)
{
debugger;
try {
if (param_LeadId != null && param_LeadId != undefined) {
//alert('Lead ID Value: ' + param_LeadId);
//alert('Dekh Yaaar: ' + GetOptionSetValue("seda_lead"));
var Acct = Xrm.Page.getAttribute("seda_casetypec");
var obj = Xrm.Page.getAttribute("seda_lead");
alert("Lead Value Checking: " + obj);
alert("Uzwa Checking: " + Acct);
var filter = "<filter type='and'>" +
"<condition attribute='seda_lead' operator='eq' value='" + param_LeadId + "'/>" +
"</filter>";
//filter booth services based on the booth selected in participant screen
Xrm.Page.getControl("primarycontactid").addCustomFilter(filter);
Xrm.Page.getControl("primarycontactid").addPreSearch(function () {
Xrm.Page.getControl("primarycontactid").addCustomFilter(filter);
}
}
catch (e) {
throw new Error(e.message);
}
}