6

[Edited from original post]

I'm trying to open the links that come up from my Content Query Web Parts. However, I'm having a problem which I'll now explain:

In my list, I have four content types - only THREE of which are used. (The default ITEM type is unused). I've created forms in InfoPath for NEW, VIEWing and EDITing of each of these three items.

I created a CQWP that brings up links to related list items. Each of these items should open in the correct form based on their content type. However, when they open, they try to open as ITEM content type (which I don't use). How can I make them open with the correct content type?

4
  • perhaps you need to ensure that your forms are correctly associated with your list content types. e.g. sharepoint.stackexchange.com/questions/121673/… Mar 11, 2019 at 17:08
  • The forms are already associated properly.
    – DanJ
    Mar 11, 2019 at 17:25
  • Can you paste here one of your links rendered through CQWP? Are you appending the parameter for content type id to the links? Mar 11, 2019 at 19:18
  • In the CQWP, under Content Type, I have changed this area to show Custom Content Type, and the appropriate type/form for that web part. An example of the link that's rendered upon clicking the web part link is: https://.../Lists/Management/Item/displayifs.aspx? Here, you can see that the link comes up with the type "Item" (if that's indeed what that is in the link)
    – DanJ
    Mar 12, 2019 at 15:31

1 Answer 1

1

I tried your scenario in SharePoint Online environment and it worked fine with the following settings:

  • Created 2 list content types with different set of columns
  • Created new list and added both content types to it
  • Went to List settings -> Form settings, selected Use a custom form for one or more content types using InfoPath radio button, chose first CT, opened form in InfoPath, customized it and published it to SP Online.
  • Did the same for the other CT
  • Added a couple of items of each CT to the list
  • Created wiki page and added Content Query Web Part to it
  • Changed the CQWP settings to the following: In Query -> Source, selected Show items from the following list: and chose the list.
  • Left the (default) value of Show items of this content type group: combo box to All Content Types.
  • Saved the page

The CQWP now renders the links to the items in the following format: https://MYSITEURL/_layouts/15/CopyUtil.aspx?Use=id&Action=dispform&ItemId=XXX&ListId=YYY&WebId=ZZZ&SiteId=AAA&Source=sourceurl After you click on the link, you get redirected to the appropriate InfoPath form, based on the CT of the item. The link of the rendered form is in the format: Lists/TestListIPCT/CTNAME/displayifs.aspx?... (It does not contain Item like you mentioned in the comment, but the name of appropriate CT).

You didn't mention if you have made any additional changes, like modifying the xslt templates, so If you did that you should check those modifications if they had anything to do with the rendering of the links.

1
  • To start with the differences, I'm using SP 2013 (for what it's worth). Since the list and IP forms have already been created, here's what I get under List Settings -> Form Settings: Content Type Customize the form for the following content type: (ddl of my list of the 4 items, including the non-used 'Item') Radio Buttons for: Modify the existing InfoPath form; Use the default SharePoint form. (the DDL above is set to the first custom content type as the default). As far as similarities go, my CQWP is set up just as yours is, above. The error remains. Ideas?
    – DanJ
    Mar 18, 2019 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.