Error in the Custom JS

Home Forums SPJS-Lookup Error in the Custom JS

Viewing 2 reply threads
  • Author
    Posts
    • #6904
      Jeff Law
      Participant

        HI,

        I am trying to test out the new version of SPJS-Lookup, but I keep running into a problem where I get the “DFFS: There is an error in the Custom JS”.

        I haven’t been able to track down what the problem is, and I must confess to not being a js expert, so most of my troubleshooting is by comparison and trial and error 🙂

        My latest incarnation is as follows:

        
        
        spjs.lookup.init({
        	fieldToConvertToDropdown:"jslCompanies",	
        	listName:"Companies",
        	listBaseUrl:"/",
        	optTextFieldInternalName:"Title",
        	sortFieldName:"Title",
        	filterObj:{
        		on:false,
        		CAML:null, 
        		fin:"Completed",
        		isLookup:false,
        		operator:"Neq",
        		filterVal:"1"
        	},
        	dropDownDefaultvalue:"...",
        	addYouOwnValue:{
        		on:false,
        		linkText:"Write your own value"
        	},
        	addToExternalList:{
        		on:false,
        		customFunction:null, 
        		linkText:"Add new item",
        		saveNewItemText:"Save new item"
        	},
        	debug:false
        });

        I have tried with the parameter names enclosed in quotes as per web site article as well. eg

        "fieldToConvertToDropdown":"jslCompanies",

        Is there some basic js thing that I have missed?

        Also, I was wondering if the filterObj, addYourOwnValue, and addToexternalList were optional parameters and could be left out if you didn’t want to use the functionality.

        Regards
        Jeff

      • #6907
        Jeff Law
        Participant

          Ok, found the problem… Actually a combination of 2 things, but the primary one was.. and this is even more embarrassing as this didn’t get copied across correctly above…

          I seem to have added a $ in front of spjs.lookup.init({.. eg $spjs.lookup.init({…

          It does have to be without the $ sign 🙂

          By removing that $, and making sure the CEWP was below the form, I now get a result!!

        • #6926
          Alexander Bautz
          Keymaster

            I’m glad you figured it out.

            Alexander

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.