TypeError:Cannot read property 'SPCascadeDropdowns' of undefined

Forums Classic DFFS TypeError:Cannot read property 'SPCascadeDropdowns' of undefined

Viewing 1 reply thread
  • Author
    Posts
    • #19530
      Melissa Hamilton
      Participant

      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>

      1. <b>Hyperlink to Previously Produced Report (if available):</b>
      2. <b>Data Sources (ie. Remedy, PTP):</b>
      3. <b>Report Granularity (ie. server, application):</b>
      4. <b>Fields (ie. RAMServerName):</b>

      “);
      break;
      case “Develop ongoing report”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Hyperlink to Mockup Report (or you may attach report to PR):</b>
      2. <b>Data Sources (ie. Remedy, PTP):</b>
      3. <b>Report Granularity (ie. server, application):</b>
      4. <b>Field Names (ie. RAMServerName):</b>
      5. <b>Refresh Frequency (ie. Daily, weekly):</b>

      “);
      break;
      case “Modify existing report”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Hyperlink to Existing Report:</b>
      2. <b>Data Source for New Fields/Graphs (ie. Remedy, PTP):</b>
      3. <b>New Fields: </b>
      4. <b>New Graphs:</b>
      5. <b>New Filters or Parameters:</b>

      “);
      break;
      case “Develop Solution”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Data Sources (ie. Remedy, PTP):</b>
      2. <b>Data Granularity (ie. server, applicationt):</b>
      3. <b>SOR Fields (ie. RAMCIID):</b>
      4. <b>User Editable Fields and Types (ie. Name=Status, Type=Dropdown, Values=In Progress,Active):</b>
      5. <b>SOR Data Refresh Frequency (daily, weekly):</b>
      6. <b>Unique Permissions (otherwise default groups will be used):</b>

      “);
      break;
      case “Modify Solution”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Hyperlink to Existing Site:</b>
      2. <b>Data Source for New Fields (ie. Remedy, PTP):</b>
      3. <b>New SOR Fields (ie. RAMCIID):</b>
      4. <b>New User Editable Fields and Types (ie. Name=Status, Type=Dropdown, Values=In Progress,Active):</b>
      5. <b>Permissions Changes:</b>

      “);
      break;
      case “Establish new ETL”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>New Data Sources (ie. Remedy, PTP):</b>
      2. <b>New Fields:</b>
      3. <b>Data Source Type (SQL Server, Oracle, Excel, SharePoint):</b>
      4. <b>Hyperlink or Connection String (if incoming):</b>
      5. <b>Account Needing Access (if outgoing):</b>
      6. <b>Fields (if outgoing):</b>

      “);
      break;
      case “Modify existing ETL”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Changing Data Sources (ie. Remedy, PTP):</b>
      2. <b>Changing Fields:</b>
      3. <b>Data Source Type (SQL Server, Oracle, Excel, SharePoint):</b>
      4. <b>Hyperlink or Connection String (if incoming):</b>
      5. <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>

      1. <b>Name:</b>
      2. <b>Start Date:</b>
      3. <b>LAN ID:</b>
      4. <b>Employee Number:</b>
      5. <b>DTC (if available):</b>
      6. <b>Employee Number:</b>
      7. <b>Phone Number (if available):</b>
      8. <b>Location:</b>
      9. <b>Site contact & MAC:</b>
      10. <b>Resource Type:</b>
      11. <b>Profile Type:</b>
      12. <b>Special Requests (i.e. cell phone, monitor, headset):</b>

      “);
      break;
      case “Team Member Offboarding (Internal Only)”:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Name:</b>
      2. <b>End Date:</b>
      3. <b>End Type (leaving TMRO or WF):</b>

      “);
      break;
      default:
      setFieldValue(“Body”,”<b>Requirements:</b>

      1. <b>Sample Requirement 1:</b>
      2. <b>Sample Requirement 2:</b>
      3. <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&#8221;;
      }*/

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

    • #19566
      Alexander Bautz
      Keymaster

      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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.