A coworker pointed me to this blog entry today: http://blogs.msdn.com/sharepointdesigner/archive/2008/03/26/sharepoint-conference-building-a-sharepoint-designer-mashup-part-1.aspx
It explains how to use an undocumented feature of the Data View web part to filter content using a lookup field’s ID instead of its display value. There are a few scenarios where this becomes really useful. The most common one being that you want to create a dashboard that displays parent/child data on the same page. You might do this on an extra page or within a custom dispform.aspx for the parent list.
It’s oh-so-easy: In the DVWP for the child data, configure it as you always would. For the filter, base it on the lookup column and set it to a parameter where your ID will be (probably a query parameter). Then go to code view and in the CAML select statement for the child, add LookupID="TRUE" to the FieldRef of your where clause.
selectcommand=”<View><Query><Where><Eq><FieldRef LookupId="TRUE" Name="Supplier"/><Value Type="Text">{SupplierID}</Value></Eq></Where></Query></View>”
I can’t believe I’ve never run across this tip before. It would have made my life easier on a number of occasions. Thanks, Jason C.
P.S. I love this game.