CAML filter on Lookup column

Feb 24, 2012 at 3:33 PM

In my CAMLQuery, I'm trying to grab all the child records in another list that relate to my current project.  The child list has a lookup column that displays the Project ID from the parent list. 

I can't seem to get this right in the spservices function.    Should I be passing the integer ID of the parent record, or the string value of the parent column that the lookup draws from?  ...or...."295;#Stringvalue" ???

I saw something about using "LookupId='TRUE'"...any need for that?   I have both the ID and the string value from the parent record stored in vars. 

BTW-Our network geniuses have blocked access to your code snippet popup. 

Don

 

Feb 24, 2012 at 5:33 PM

OK, I got the query to finally pull the related records.  I had a combination of problems.  I ended up using the LookupId='TRUE' setting and passing the ID to the query.  

Feb 25, 2012 at 1:33 AM

Don,
That is what I use. Using the ID insures you always get the associated records from the second list. One last suggestion. When you define the value (the ID of your project), set the type to integer (ex: <value type='integer'>15000</value>)... this is important if your list will grow to be very large.

Paul

Sent from mobile

On Feb 24, 2012 1:33 PM, "DonLenhart" <notifications@codeplex.com> wrote:

From: DonLenhart

OK, I got the query to finally pull the related records. I had a combination of problems. I ended up using the LookupId='TRUE' setting and passing the ID to the query.

Read the full discussion online.

To add a post to this discussion, reply to this email (SPServices@discussions.codeplex.com)

To start a new discussion for this project, email SPServices@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com