Home › Forums › SPJS-Lookup › filterObj not configured correctly.
- This topic has 2 replies, 2 voices, and was last updated 4 years, 9 months ago by
Brian Oster.
Viewing 2 reply threads
-
AuthorPosts
-
-
June 29, 2021 at 20:55 #33964
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 4 years, 9 months ago by
Brian Oster.
-
This topic was modified 4 years, 9 months ago by
Brian Oster.
-
This topic was modified 4 years, 9 months ago by
Brian Oster.
-
This topic was modified 4 years, 9 months ago by
-
June 29, 2021 at 21:15 #33971
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
-
June 29, 2021 at 21:20 #33973
Worked perfectly, thanks.
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.