Solved

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

Posted on 2015-02-02
1
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javascript and jquery question 4 44
CSS Formatting Getting Stripped 1 30
Post from Jquery mobile form goes wrong in classic asp action page 2 32
Multiple of Image Swaps 5 39
This article discusses how to create an extensible mechanism for linked drop downs.
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
The viewer will learn how to dynamically set the form action using jQuery.
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…

734 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