I have a Relationships list that has two lookups into another list. The Relationships list documents how any two items in List A relate to one another. I want to show a List View on the form for List A that will show all Relationship entries where the currently displayed item is either lookup 1 or lookup 2. I have been trying to build a CAML query to accomplish this, but have had no success.
The CAML query above produces the following error on the form in red text:
"Name cannot begin with the ' ' character, hexadecimal value 0xA0. Line 4, position 49."
Any help is greatly appreciated!
Sorry, I need to correct myself. This is not an issue with us.
The error which is reproduced, is related to character formatting issue so pass the query like the sample I put for you here and delete all white spaces. You need to remove the <Where> tag as well.
To test, please pass the following query to your filtering. This should work and please let me know if you still see the issue.
<Eq><FieldRef Name="lookup"/><Value Type="Lookup">test04</Value></Eq>
I've cleared out all the white space and that did resolve the error from the form. However, the following CAML query still does not give me the desired results:
I have used ID to filter a list view by lookup before by setting it up as follows:
What if you pass the value for ID? Do you get results which you expect? I suggest start with a simple query and then add complexity to it. So it will tell us where this query going to have issue
Thank you again, Shahrzad. The CAML query worked after I changed it to use the item's Title rather than ID. I was thrown off because the "By a specified value" filter worked by ID.
To summarize all steps for the answer in a single post: