Solved

CAML Query - People Picker Field - _ ALSO trigger when selection is made using SharePoint

Posted on 2015-02-02
1
375 Views
Last Modified: 2015-04-22
I am working with an SPServices call and CAM Query. Trying to do a filter against a value in a People Picker field in SharePoint 2007.

I am continually getting an error on the execution of the Query no matter how I set up the parameters for the People Picker field. Please advise what I need to change. I need to filter against the current value in the People Picker input area.

A second issue is that I can have the code trigger when a value is manually entered into the input area but it won't trigger if the actual People Picker is used.

here is current code

function EmployeeCheck() {	
    //Setting variables
		ShowDialog = false;
		

        EmployeeID = $('textarea[title="People Picker"]').val(); 

		//Setting the CAML query
  		SPCAMLQuery = '<Query><Where><And><And><Includes><FieldRef Name="Field_x0020_Employee_x0020_Name" /><Value Type="Text">' + EmployeeID + '</Value></Includes><Geq><FieldRef Name="Date_x0020_of_x0020_Observation" /><Value IncludeTimeValue="FALSE" Type="DateTime">2014-01-01</Value></Geq></And><IsNull><FieldRef Name="Observation_CanceledReason" /></IsNull></And></Where></Query>';
    

Open in new window

0
Comment
Question by:aehrenwo
1 Comment
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40727274
Hi,
the people picker is quite tricky - as the HTML DOM beyond from what you see in the browser is quite complicated.
But the following should exactly retrieve the displayed value:
jQuery("textarea[title='People Picker']").closest("td").find("#content").text();

Open in new window

For the second issue:
How have you implemented the triggers?
But perhaps the second one is worth an additional question.

Thanks and HTH
Rainer
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now