From: http://spservices.codeplex.com/discussions/346508
Did anyone get this figured out? I have run into the same issue. Using 'matchOnId: true' causes the function to return 0 items. I believe I have the solution. I'm using SPServices 0.7.1a so if this has already been fixed in later releases, my apologies.
Looking at line ~1739, we're creating a query string as...
```
camlQuery += "<Eq><FieldRef Name='" + opt.relatedListColumn +
(opt.matchOnId ? "' LookupId='True'/><Value Type='Integer'>" : "'/><Value Type='Text'>") +
escapeColumnValue(columnSelectSelected[0]) + "</Value></Eq>";
```
When matchOnId = true, I beleive we should be filtering on the ID field of the target list and not the opt.relatedListColumn. So, I modified the source code to look like this....
```
camlQuery += "<Eq><FieldRef Name='" +
(opt.matchOnId ? "ID' /><Value Type='Integer'>" : opt.relatedListColumn + "'/><Value Type='Text'>") +
escapeColumnValue(columnSelectSelected[0]) + "</Value></Eq>";
```
I believe this comes up in other places in the code but I haven't gone through it. I wanted to get a second look at my madness before I press on.
Thanks,
Geoff
Did anyone get this figured out? I have run into the same issue. Using 'matchOnId: true' causes the function to return 0 items. I believe I have the solution. I'm using SPServices 0.7.1a so if this has already been fixed in later releases, my apologies.
Looking at line ~1739, we're creating a query string as...
```
camlQuery += "<Eq><FieldRef Name='" + opt.relatedListColumn +
(opt.matchOnId ? "' LookupId='True'/><Value Type='Integer'>" : "'/><Value Type='Text'>") +
escapeColumnValue(columnSelectSelected[0]) + "</Value></Eq>";
```
When matchOnId = true, I beleive we should be filtering on the ID field of the target list and not the opt.relatedListColumn. So, I modified the source code to look like this....
```
camlQuery += "<Eq><FieldRef Name='" +
(opt.matchOnId ? "ID' /><Value Type='Integer'>" : opt.relatedListColumn + "'/><Value Type='Text'>") +
escapeColumnValue(columnSelectSelected[0]) + "</Value></Eq>";
```
I believe this comes up in other places in the code but I haven't gone through it. I wanted to get a second look at my madness before I press on.
Thanks,
Geoff