CAML Filter on Related List

It appears as though there is an issue with CAML filter on a list when filtering on multiple conditions. Using the following code:

> fd.control('OILOld').filter = "<And><Eq><FieldRef Name='Project' LookupId='TRUE'/><Value Type='Lookup'>" + window.top.fd.itemId + "</Value></Eq><Lt><FieldRef Name='MeetingID' LookupId='TRUE'/><Value Type='Lookup'>" + num + "</Value></Lt></And>";

I believe this is the correct context, however I do not receive all of the values.

Hello @cwalter2,

The query is correct.

Please try to replace dynamic values such as num and window.top.fd.itemId with static values.
Are you getting the correct results?

If yes, please share the complete code that you are using for filtering List or Library control.

Thank you for your response @mnikitina,

I did go back and hard code those values and it did not work, however it did clue me into the issue. It seems the 'Project' lookup did not get populated on the item I was expecting to see. After, adding it to the list item it worked as expected.

1 Like