Home › Forums › Classic DFFS › TypeError:Cannot read property 'SPCascadeDropdowns' of undefined
Tagged: SPCascadeDropdowns
- This topic has 1 reply, 2 voices, and was last updated 6 years, 10 months ago by Alexander Bautz.
-
AuthorPosts
-
-
January 30, 2018 at 21:10 #19530
I am trying to update my DFFS forms to the latest production release. I keep running into this error:
TypeError:Cannot read property ‘SPCascadeDropdowns’ of undefined
Here is a sample of my CustomJS
function hideCalendarPicker(){
$(“iframe[id$=’DateTimeFieldDateDatePickerFrame’]”).attr(“src”, “/_layouts/15/images/blank.gif?rev=38″);
}function filterProcessFunction (){
/*if PRExclude in Process list equals No then show in the dropdown and cascade from TMRO Service field*/
var strCAMLQueryProcess=”<And><Eq><FieldRef Name=’ProcessStatus’ /><Value Type=’Choice’>Active</Value></Eq><Eq><FieldRef Name=’PRExclude’ /><Value Type=’Choice’>False</Value></Eq></And>”;
$().SPServices.SPCascadeDropdowns({
relationshipList: “Processes”,
relationshipListParentColumn: “Service”,
relationshipListChildColumn: “Title”,
relationshipListSortColumn: “Title”,
parentColumn: “TMRO Service”,
childColumn: “Process”,
CAMLQuery: strCAMLQueryProcess,
debug: true
});
} /*end Process filterProcessFunction*/function filterPrimaryFunction (){
/*if Status not Complete/Cancelled/Declined/Archived filter Primary Function field to show only items where Status = Active*/
var strFilter1=”<Eq><FieldRef Name=’Status’ /><Value Type=’Choice’>Active</Value></Eq>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Functions”,
relationshipListColumn: “Title”,
columnName: “Primary Function”,
CAMLQuery: strFilter1,
debug: false
});
} /*end function filterPrimaryFunction*/function filterServiceFunction (){
/*if Service Status=”Active” and PRExclude=”No” then show in the dropdown*/
var strServiceFilter=”<And><Eq><FieldRef Name=’ServiceStatus’ /><Value Type=’Choice’>Active</Value></Eq><Eq><FieldRef Name=’PRExclude’ /><Value Type=’Choice’>False</Value></Eq></And>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Services”,
relationshipListColumn: “Title”,
columnName: “TMRO Service”,
CAMLQuery: strServiceFilter,
debug: false
});
}/*end function DMRTServiceFieldDropdown*/function populateCriticalTopicFieldDropdown (){
/*if Status not Complete/Cancelled/Declined/Archived filter Critical Topic field as a cascade from Related Topic field, hiding related values that are Complete or Archived on the Critical Topics list */
var strCAMLQuery=”<And><Neq><FieldRef Name=’Status’ /><Value Type=’Choice’>Complete</Value></Neq><Neq><FieldRef Name=’Status’ /><Value Type=’Choice’>Archived</Value></Neq></And>”;
$().SPServices.SPCascadeDropdowns({
relationshipList: “Critical Topics”,
relationshipListParentColumn: “Related_x0020_Topic”,
relationshipListChildColumn: “Title”,
relationshipListSortColumn: “Title”,
parentColumn: “Related Topic”,
childColumn: “Critical Topic”,
CAMLQuery: strCAMLQuery
});
}function filterRelatedTopicField (){
/*if Status not Complete/Cancelled/Declined/Archived filter Related Topic field to show only items where Status = Active*/
var strFilter=”<Eq><FieldRef Name=’Status’ /><Value Type=’Choice’>Active</Value></Eq>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Topics”,
relationshipListColumn: “Title”,
columnName: “Related Topic”,
CAMLQuery: strFilter,
debug: false
});
}function filterPartnerField(){
/* **added for PR 13851, 15901, 16543 */
var strFilter2=”<And><Eq><FieldRef Name=’Status’ /><Value Type=’Choice’>Active</Value></Eq><Neq><FieldRef Name=’Partner_x0020_Type’ /><Value Type=’Choice’>Provider Partner</Value></Neq></And>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Partners”,
relationshipListColumn: “Title”,
columnName: “Partner”,
CAMLQuery: strFilter2
});
}function populateDescription (){
var Process = getFieldValue(“Process”);
switch(Process){
case “Develop ad-hoc/1 time report”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Hyperlink to Previously Produced Report (if available):</b>
- <b>Data Sources (ie. Remedy, PTP):</b>
- <b>Report Granularity (ie. server, application):</b>
- <b>Fields (ie. RAMServerName):</b>
“);
break;
case “Develop ongoing report”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Hyperlink to Mockup Report (or you may attach report to PR):</b>
- <b>Data Sources (ie. Remedy, PTP):</b>
- <b>Report Granularity (ie. server, application):</b>
- <b>Field Names (ie. RAMServerName):</b>
- <b>Refresh Frequency (ie. Daily, weekly):</b>
“);
break;
case “Modify existing report”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Hyperlink to Existing Report:</b>
- <b>Data Source for New Fields/Graphs (ie. Remedy, PTP):</b>
- <b>New Fields: </b>
- <b>New Graphs:</b>
- <b>New Filters or Parameters:</b>
“);
break;
case “Develop Solution”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Data Sources (ie. Remedy, PTP):</b>
- <b>Data Granularity (ie. server, applicationt):</b>
- <b>SOR Fields (ie. RAMCIID):</b>
- <b>User Editable Fields and Types (ie. Name=Status, Type=Dropdown, Values=In Progress,Active):</b>
- <b>SOR Data Refresh Frequency (daily, weekly):</b>
- <b>Unique Permissions (otherwise default groups will be used):</b>
“);
break;
case “Modify Solution”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Hyperlink to Existing Site:</b>
- <b>Data Source for New Fields (ie. Remedy, PTP):</b>
- <b>New SOR Fields (ie. RAMCIID):</b>
- <b>New User Editable Fields and Types (ie. Name=Status, Type=Dropdown, Values=In Progress,Active):</b>
- <b>Permissions Changes:</b>
“);
break;
case “Establish new ETL”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>New Data Sources (ie. Remedy, PTP):</b>
- <b>New Fields:</b>
- <b>Data Source Type (SQL Server, Oracle, Excel, SharePoint):</b>
- <b>Hyperlink or Connection String (if incoming):</b>
- <b>Account Needing Access (if outgoing):</b>
- <b>Fields (if outgoing):</b>
“);
break;
case “Modify existing ETL”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Changing Data Sources (ie. Remedy, PTP):</b>
- <b>Changing Fields:</b>
- <b>Data Source Type (SQL Server, Oracle, Excel, SharePoint):</b>
- <b>Hyperlink or Connection String (if incoming):</b>
- <b>Account Needing Access (if outgoing):</b>
“);
break;
case “Remedy Owned By Record Maintenance”:
setFieldValue(“Body”,”<b>DO NOT USE THIS FORM TO REQUEST OWNED BY CHANGES TO ASSET RECORDS</b><br>Please provide a brief overview of what you are requesting and attach a completed matrix.”);
break;
case “Team Member Onboarding (Internal Only)”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Name:</b>
- <b>Start Date:</b>
- <b>LAN ID:</b>
- <b>Employee Number:</b>
- <b>DTC (if available):</b>
- <b>Employee Number:</b>
- <b>Phone Number (if available):</b>
- <b>Location:</b>
- <b>Site contact & MAC:</b>
- <b>Resource Type:</b>
- <b>Profile Type:</b>
- <b>Special Requests (i.e. cell phone, monitor, headset):</b>
“);
break;
case “Team Member Offboarding (Internal Only)”:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Name:</b>
- <b>End Date:</b>
- <b>End Type (leaving TMRO or WF):</b>
“);
break;
default:
setFieldValue(“Body”,”<b>Requirements:</b>- <b>Sample Requirement 1:</b>
- <b>Sample Requirement 2:</b>
- <b>…</b>
“);
break;
} /*end switch stmt*/
}/*function remedyRedirect (){
alert(“The DMRT Partner Request System is no longer”+’\n’+”used to request Remedy asset record updates.”+’\n’+”Please submit your request using TARUS.”+’\n’+”You will be redirected now.”);
window.location=”https://tarus.wellsfargo.com/Requests/CollectInfo”;
}*/function releaseManagementRules (){
var prPrimaryFunction = getFieldValue(“PrimaryFunction”);
var prStatus=getFieldValue(“Status1″);
if((prPrimaryFunction==”Tools Development” || prPrimaryFunction==”Data Enablement” || prPrimaryFunction==”Reporting & Metrics”) && (prStatus ==”In Queue” || prStatus== “Active”))
{
return true;
}
else
{
return false;
}
}$(document).ready(function() {
/*check Status of PR*/
var prStatus=getFieldValue(“Status”);
/*alert (“prStatus is: ” + prStatus);*/if(prStatus ==”Complete” || prStatus == “Cancelled” || prStatus == “Declined” || prStatus == “Archived”){
return;/*do nothing*/
}
else {
filterProcessFunction ();
filterPrimaryFunction ();
filterRelatedTopicField ();
populateCriticalTopicFieldDropdown ();
filterServiceFunction ();
filterPartnerField ();
filterProviderPartnerField ();
} /* end else */
}); /*end ready function*//*remove underlines not needed at bottom of form*/
$(document).ready(function(){
$(“#onetidinfoblock1”).closest(‘tr’).css(‘border’,’none’);
$(“#onetidinfoblock2”).closest(‘tr’).css(‘border’,’none’);
$(“.ms-ButtonHeightWidth”).closest(‘tr’).css(‘border’,’none’);
$(“#dffsEnterSetupBtn”).closest(‘tr’).css(‘border’,’none’);
$(“[id$=’owshiddenversion’]”).closest(‘tr’).css(‘border’,’none’);
$(“.ms-toolbar”).closest(‘tr’).css(‘border’,’none’);
$(“[id$=’InitContentType’]”).closest(‘tr’).css(‘border’,’none’);
$(“.ms-list-addnew”).closest(‘tr’).css(‘border’,’none’);
$(“.ms-vh-selectAllIcon”).closest(‘tr’).css(“border”,”none”);
$(“#scriptWPQ7”).closest(‘tr’).css(“border”,”none”);
$(“.ms-itmhover”).closest(‘tr’).css(“border”,”none”);
$(“#onetidinfoblockV”).closest(‘tr’).css(“border”,”none”);
$(“.ms-dtinput”).closest(‘tr’).css(“border”,”none”);
});/*Planning tab only show Processes where Function = Business Partner Engagement or CR-IM (PR21479)*/
var strPlanningProcess1=”<Or><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>Business Partner Engagement</Value></Eq><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>CR-IM</Value></Eq></Or>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Processes”,
relationshipListColumn: “Title”,
columnName: “PlanningActivity1″,
CAMLQuery: strPlanningProcess1,
debug: true
});var strPlanningProcess2=”<Or><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>Business Partner Engagement</Value></Eq><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>CR-IM</Value></Eq></Or>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Processes”,
relationshipListColumn: “Title”,
columnName: “PlanningActivity2″,
CAMLQuery: strPlanningProcess2,
debug: true
});var strPlanningProcess3=”<Or><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>Business Partner Engagement</Value></Eq><Eq><FieldRef Name=’Function’ /><Value Type=’Choice’>CR-IM</Value></Eq></Or>”;
$().SPServices.SPFilterDropdown({
relationshipList: “Processes”,
relationshipListColumn: “Title”,
columnName: “PlanningActivity3”,
CAMLQuery: strPlanningProcess3,
debug: true
}); -
February 1, 2018 at 23:00 #19566
It looks like you might be missing a reference to SPServices in your code as the “SPCascadeDropdowns” function is part of this solution.
If you are upgrading from an older solution where custom scripts were loaded in a “custom” folder you must load the files in the top of the “Custom JS” tab.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.