Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Resolving the actual list location of items queried using CrossList

  Asked By: Anila    Date: Apr 22    Category: Sharepoint    Views: 1516

I have created a custom list in several different webs that contains a
listing of product names (and other info too, but to make this simple,
let's just say it's a listing of product names). I have a "Product"
content type that is attached to each list and contains the product

What I am wanting to do is create a roll up view where all of the
product names in those individual lists is shown in one master aggregate
list to make it easier to find a particular product rather than poking
around a dozen or so different lists individually.

I have this working so far using a Data View and SPDataSource with a
cross list query where I am querying based on the content type. What I
am missing is in the aggregate list view I would like to be able to have
a link back to the web that contains the actual list item. I can't see
any way to do this using SPDataSource. There is a ScopeId GUID field
that seems to relate to the location of the actual data (all of the
items from the same list seem to contain the same ScopeId), but I can't
seem to find a way to cross-reference ScopeId to any type of list ID or
web ID (I looked at the output of SPDataSource using the ListOfLists and
Webs options and couldn't find any reference to any of the ScopeIds from
the list items).

I could do this in code by enumerating the webs and performing a
separate SPQuery for each web, but I wanted to see if there was some
easier and faster way to solve this problem.

Hopefully this makes sense. Any ideas?



5 Answers Found

Answer #1    Answered By: Marianne Vance     Answered On: Apr 22

The easiest solution would probably be to add an additional column to the
content types for each list  that store the URL of the list. Without that I
suspect the only way to do what you want involves coding.

Answer #2    Answered By: Aayushman Kanvinde     Answered On: Apr 22

Would this column have to be populated by hand or is there a way that it
could be filled in automatically?

Answer #3    Answered By: Edgardo Atkins     Answered On: Apr 22

Probably the easiest way would be to set a default value on the column in each
list. When records are created  the value will be added. I suspect you could
also use a calculated column based  on text formatting of another field in the
list. But that would depend on what other fields are avaialble.

Answer #4    Answered By: Kamal Mayachari     Answered On: Apr 22

Since you said you're using a DVWP, here's what you can do:

1. In the DVWP, create  a new column
2. In this column, Just type  the text that you would like users to
click on, such as "Path"
3. Select the "Path" text, and make it a hyperlink.
4. In the Address part of the hyperlink settings, type a backslash,
and then click the little Fx function button to pick a field. Pick the
Path field.
5. After you click OK, your Address field will look like this:
6. Click OK.

Done. Save your DVWP, and try it out in the browser.

Answer #5    Answered By: Kelsie Terrell     Answered On: Apr 22

I didn't notice the Path/FileDirRef
column before, but that was what I was looking for!