2. December 2009 07:55
Yes its possible!
Your filter for the CAML query probably looks like this currently:
<FieldRef Name ="Customer"/>
<Value Type ="Text">
But the "Customer" field is a lookup column to a different list of customers and on most view pages for customers, you probably need to fetch the related data using the Customer ID (the ID column for the customer list) and not the customer name.
Also, Sharepoint designer 2007 does not, using the UI, allow you to set a filter on a data form webpart and using a lookup column's ID field. You can only use the value of a lookup column in the filter.
Here's how I was able to do it after a bit of research...
<FieldRef Name ="Customer" LookupId="true" />
<Value Type ="Lookup">
Just add the LookupId = "true" attribute to the FieldRef tag and change the Value Type attribute to "Lookup". Your filter now looks up the value of the lookup column by using the ID of the item instead of the value.