Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

Edited Issue: SPDisplayRelatedInfo not working with matchOnId: true [10134]

$
0
0
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


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>