filterObj not configured correctly.

Forums SPJS-Lookup filterObj not configured correctly.

Viewing 2 reply threads
  • Author
    Posts
    • #33964
      Brian Oster
      Participant

      My list item has a [ProjectID] field. I want to lookup into another list that also has a [ProjectID] field and filter the lookup on that field but what I have is returning an empty list. Here is my custom JS.

      
      
      spjs.lookup.init({
          "fieldToConvertToDropdown": [
              "Custom_x0020_Category_x0020_1"
          ],
          "listName": "{D8EC3282-5627-4637-99A5-70844CD0D590}",
          "listBaseUrl": "/development/pmpoc3",
          "optTextFieldInternalName": "Title",
          "pipeDelimitedOptions": "false",
          "optValFieldInternalName": "ID",
          "orderBy": {
              "fin": "Title",
              "ascending": true
          },
          "clearInvalidSelections": true,
          "filterObj": {
              "on": true,
              "folder": "",
              "CAML": null,
              "fin": "Project_x0020_ID",
              "isLookup": true,
              "operator": "Eq",
              "filterVal": "[currentItem:Project_x0020_ID]"
          },
          "dropDownDefaultvalue": "",
          "allowBlank":true,
          "parseFunction": "",
          "addYouOwnValue": {
              "on": false,
              "linkText": "Write your own value"
          },
          "addToExternalList": {
              "on": false,
              "customFunction": null,
              "linkText": "Add new item",
              "saveNewItemText": "Save new item"
          },
          "debug": false,
          "customSort": ""
      });
      • This topic was modified 2 years, 9 months ago by Brian Oster.
      • This topic was modified 2 years, 9 months ago by Brian Oster.
      • This topic was modified 2 years, 9 months ago by Brian Oster.
    • #33971
      Alexander Bautz
      Keymaster

      You cannot use the string “[currentItem:Project_x0020_ID]” as filterVal – you must use something like this to get the actual value from the select:

      "filterVal": jQuery("#dffs_Project_x0020_ID option:selected").val()

      Alexander

    • #33973
      Brian Oster
      Participant

      Worked perfectly, thanks.

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