This project has moved and is read-only. For the latest updates, please go here.

SPDisplayRelatedInfo not working on items in folders

Oct 30, 2012 at 6:49 AM

Hi, I’m using SPDisplayRelatedInfo on a lookup field to an picture library to show a thumbnail but I have found that it is not showing thumbnails/looking up information for images that are in subfolder, only for items directly in the root of the library.  Should I not be using sub folder or is there a way to make it work?


Nov 1, 2012 at 1:24 AM

I have come up with a work around and written a custom calm query lookup function, 

And set:

CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll' /></QueryOptions>"


To query all items in root and folders/subfolders


Nov 1, 2012 at 1:10 PM


Sorry to have not responded initially. Have you altered SPDisplayRelatedInfo to include the CAMLQueryOptions?


Nov 1, 2012 at 2:02 PM

Hi Mac, No Problem, Nothing that sophisticated, I probably should have explained myself a little better, I only had a few mins to get it working so i used the SPDisplayRelatedInfo that I already had, then added an on complete function that would detect if related info was found, if not it would run another function that would perform a CAML query using $().SPServices to find an image with an ID that was selected in the lookup dropdown, that’s where I used the:
CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll' /></QueryOptions>" to have the query find all items, even ones in sub folders.

Im happy to go into a bit more detail, its not the cleanest solution but it seems to work OK.