Forum Replies Created
-
AuthorPosts
-
March 14, 2015 at 18:55 in reply to: Get items from list "B" assigned to the person in a people picker in list "A" #7235
Hi,
This is the complete setup for SPJS-Lookup where I have used the CAML in my previous post:var argObj = { "fieldToConvertToDropdown":["SPJSLookup1"], "optTextFieldInternalName":"Title", "listName":"Tasks", "listBaseUrl":"/DFFS", "sortFieldName":"Title", "filterObj":{ "on":true, "folder":"", "CAML":"<Where><And><IsNotNull><FieldRef Name='Title' /></IsNotNull><Eq><FieldRef Name='AssignedTo' LookupId='TRUE' /><Value Type='User'>"+String(spjs.dffs.beforeProperties["Requester_ID"])+"</Value></Eq></And></Where><OrderBy><FieldRef Name='Title' Ascending='TRUE'/></OrderBy>", // Full CAML query. If used, the rest of the filterObj settings are disregarded "fin":"", "isLookup":false, "operator":"Eq", "filterVal":"" }, "dropDownDefaultvalue":"...", "addYouOwnValue":{ "on":false, "linkText":"Write your own value" }, "addToExternalList":{ "on":true, "customFunction":null, "linkText":"Add new item", "saveNewItemText":"Save new item" }, "debug":true }; spjs.lookup.init(argObj);
Regarding the people picker field name:
My people picker has FieldInternalName “Requester”, but the “beforeProperties” object has a separate property containing the ID of the person in the people picker. This is stored in the “Requester_ID” attribute. If your people picker is named “MyPeoplePickerField”, you must use “MyPeoplePickerField_ID”.I hope this clarifies it a bit.
Alexander
Hi,
Have you tested it? – I’m fairly sure this solution will remove duplicates so that only unique values show in the dropdown.Alexander
It’s hard to tell. Could there be some other code that interferes? If you have any third party code, try to disable it. If note, try to set up a new, fresh list to test it there.
Alexander
The code looks OK. Are you 100% sure this is the CEWP code you use? Have you tried to add an alert to verify that this is the one?
Alexander
Hi,
It looks like you have the wrong variable name. It is notvar spjs__spPageContextInfo = ...
but
_spPageContextInfo = ...
Alexander
Sorry, but this is not possible with the autocomplete solution, so I’m afraid you will have to go with the stock people picker field for this one.
Alexander
Hi,
The autocomplete reads the users from the user list in the site collection. My best bet for why the user does not appear is that the user have not yet signed in to the site (all users must sign in one time before they are written to the user list).Could this be the issue?
I could add a “kill” switch to the autocomplete, but I cannot use it to add people to the user list in SharePoint.
Alexander
You could use something like this: http://api.jquery.com/jquery.getscript/
Alexander
Hi,
First, DFFS should not be added to the list view – only in NewForm, DispForm and EditForm. vLookup however must be added to the list view if you want the vLookup columns to render there.The “missing” list tools can be made visible by clicking anywhere inside the “list view table” for the current list – no need to check the “select all”.
The tool you refer to is this: https://spjsblog.com/2012/01/12/bring-back-the-missing-list-tools-menu-in-list-view-with-multiple-webparts/
I have not tested this in SP2013.
Alexander
Hi,
Now that I see this output it occurs to me that you have used the wrong brackets. You used curly brackets like this:{currentItem:ID}
but what you must use is square brackets like this:
[currentItem:ID]
Alexander
Hi,
Activate the debug output by appending this to the URL in your list view (or in DispForm):.../AllItems.aspx?vLookupDebug=1
Add the output (at the bottom of the screen) in an attachment here.
Alexander
Currently I cannot think of any method. I’ll add an option in vLookup to “translate” a value like you require.
It will take a few days, so check back here.
Alexander
I see. If you want to hide an entire side-by-side row you must actually address the row by the ID like this in the “Hidden headings or elements” option of the rule:
sbs_OuterTR_1
The number “1” represents the “side-by-side index” from the tabs.
Please note that if you hide the “side-by-side row” like this, you do not have to individually hide the fields in the “side-by-side row”.
This is as far as I remember not documented – sorry about that.
Hope this helps,
AlexanderI’m sorry, but as I have not experience dealing with external lists I cannot be of much help here. I hope you find the solution, and when you do, please post back the solution here.
Alexander
I’ll have to see some screenshot to know what you mean. One before hiding, and one after.
Alexander
-
AuthorPosts