SPDisplayRelatedInfo in DispForm

Mar 1, 2012 at 2:37 AM

If I understand correctly, SPDisplayRelatedInfo is built to work with drop-downs, on newform or editform.

Is there a variation for dispforms?

Coordinator
Mar 1, 2012 at 6:31 AM
No, there isn't. For a DispForm, you're better off using a DVWP, as there's no need for client side processing.

M.
Mar 1, 2012 at 10:25 PM

I told ya, it's an addiction... Thanks for the reply Marc!

Mar 11, 2012 at 6:46 AM

Marc, in your reply, I assume you are talking about joined subviews.

I am still working on this. In particular, I read your article here:

http://sympmarc.com/2009/07/24/the-right-way-to-join-two-lists-in-a-dvwp/

If I understand correctly, using a joined subview here will be highly inefficient, as I am going to retrieve the whole content of the lookup list, while I just need one item (as the page is a dispform). So it still seems to me that using a Web service will be more efficient.

Is there something I misunderstood?

Coordinator
Mar 12, 2012 at 2:30 AM

You can filter your DVWP using the ID parameter on the Query String, so you shouldn't have much of an efficiency issue.

M.

Mar 12, 2012 at 3:53 AM

I think it's more complicated than that. The ID needed to filter the DVWP is the ID in the lookup field, while the ID in the URL QueryString is the current item ID.

Coordinator
Mar 12, 2012 at 1:51 PM

Well, without knowing the specifics of what you want to do, it's hard to say. You can also simply build custom script that does calls to the Web Services with SPServices' core to do exactly what you need.

M.

Mar 12, 2012 at 4:48 PM

Well, what I need is easy to describe: it is exactly what SPDisplayRelatedInfo does, I just need it on DispForm.aspx instead of NewForm or EditForm.

I could definitely write a call to a Web service (REST), but SPDisplayRelatedInfo felt so close to the result...

Coordinator
Mar 12, 2012 at 7:52 PM

Well , it's not exactly the same because SPdisplayRelatedInfo shows data based on a changed value in a dropdown. There aren't any dropdowns on a DispForm.

You can use GetListItems and display the items however you'd like.

M.

Mar 12, 2012 at 8:15 PM

Right, but SPdisplayRelatedInfo already has a lot built in, for example a neat way to insert the related info as a table. Maybe I'll just try to tweak SPdisplayRelatedInfo to run from the display field instead of the dropdown change.

Thanks for the follow up Marc!

Coordinator
Mar 13, 2012 at 10:06 PM

Outputting the data in a table format after a call to GetListItems would be a lot easier. However, you'll have to know the ID of the lookup column value, which you may not have in a DispForm.

Trust me that a DVWP is more efficient.

M.

Mar 27, 2012 at 10:02 PM

Good product - thanks for developing this - however, same question or more clarification anyways.  I'm in the same bucket - I'm using the related info on New/ Edit forms, but still need to present the content on a display form.

When creating this DVWP - do you have more detail/ referral to other source to see this in action:

Are you suggesting:

  • Make a new display form
  • Add a new cell/ row/ other
  • Place a "related data source" in this location (fields for both in the form and the column of the related info)

I am having difficulties making this display the related field.

MORE DETAIL:

  • Products list with images is the lookup data source
  • The Product field is a selection within the New/ Edit form (displaying the related product image from the Products list)
  • Then I have to develop a custom form for the displayed content to be in a different layout/ format and I need the Product image to be on this form for display & printing purposes.

PB

 

 

 

Coordinator
Mar 29, 2012 at 1:53 PM

PB:

You've got the general idea. You'll end up with an AggregateDataSource in the DVWP. That's what you get when you create a Linked Data Source in SharePoint Designer,

M.