Page 1 of 1

Bug with remote related items

Posted: 29 Nov 2018
by PSB
in the continuation of the topic: viewtopic.php?t=2278

SP2013, last CU + Forms Designer Client 3.1.4
______________________________________________

1. create library (second web from root) with document set content type
2. Open forms designer client 3.1.4 and create display form
3. add related items table. click "change" source. choose root web. choose tasks list. choose view. choose show all items
4. save form
5. open display form - and you will see this error: "The specified object does not belong to the list"

Code: Select all

11/29/2018 22:34:44.81 	w3wp.exe (0x193C)                       	0x09E0	SharePoint Foundation         	Runtime                       	tkau	Unexpected	Microsoft.SharePoint.SPException: The specified object does not belong to the list.    Microsoft.SharePoint.SPWeb.GetItem(String strUrl, Boolean bFile, Boolean cacheRowsetAndId, Boolean bDatesInUtc, String[] fields)     в Microsoft.SharePoint.SPList.EnsureCurrentFolderInfo()     в Microsoft.SharePoint.SPList.get_EffectiveFolderPermissions()     в Microsoft.SharePoint.Utilities.RightsSensitiveVisibilityHelper.UserHasRights(PermissionContext permissionContext, SPBasePermissions permissions, PermissionMode permissionMode, SPContext context, SPWeb contextWeb, SPList contextList)     в Microsoft.SharePoint.WebControls.MenuItemTemplate.get_MenuItemTemplateHidden()     в Microsoft.SharePoint.WebControls.MenuItemTemplate.OnPreRender(EventArgs args)     в System.Web.UI.Control.PreRenderRecursiveInternal(...	4332a79e-d59c-a07b-9c2e-109f3e4393b7
11/29/2018 22:34:44.81*	w3wp.exe (0x193C)                       	0x09E0	SharePoint Foundation         	Runtime                       	tkau	Unexpected	...)     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal() ...	4332a79e-d59c-a07b-9c2e-109f3e4393b7
11/29/2018 22:34:44.81*	w3wp.exe (0x193C)                       	0x09E0	SharePoint Foundation         	Runtime                       	tkau	Unexpected	...    в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Control.PreRenderRecursiveInternal()     в System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)	4332a79e-d59c-a07b-9c2e-109f3e4393b7

Re: Bug with remote related items

Posted: 04 Dec 2018
by Nikita Kurguzov
Dear PSB,
There is indeed an issue, and it is unavoidable, because we are using default views for List and Document Libraries in Related Items. It's caused by the presence of RootFolder parameter in URL, as it is not interpreted correctly in this case. But even though the issue is unavoidable, there is a workaround - it's possible to use the main form for redirection, and while redirecting, remove RootFolder parameter from the URL.

First of all, you need to create a new Form Set to place Related Items on. Create a Form Set and set rules to something that will never happen, like:

Code: Select all

1=-1
FormSetWithRules.png
FormSetWithRules.png (16.66 KiB) Viewed 2146 times
This will ensure that users are only redirected here manually.

Next, export the main form and import it to this new Form Set, so it's fully usable:
ExportImport.png
ExportImport.png (11.42 KiB) Viewed 2146 times
Go back to main form and delete everything! This form will only be used for redirection to Form Set.

After deleting everything, you will need Form Set's ID / page name, so go back to the form that you've configured and copy it:
FormSetFormName.png
FormSetFormName.png (6.41 KiB) Viewed 2146 times
Then, go back to the Main Form and add the following code to redirect users to your Form Set and remove RootFolder property in the process (use form name here):

Code: Select all

var uri = fd.setUrlParam(decodeURIComponent(window.location.href), 'FDRedirectWithID', 'fd_Document_4b469244-cc60-47fd-9cdc-f9c3283a05aa_Display.aspx?ID=');
fd.openForm(uri, {RootFolder: ''});
This should work! In the end, you will have an empty main form with JS to redirect users to a form set, and form set can have Related Items Tasks List and it would function properly.

Now, this solution is cumbersome, but there is no workaround, as it's one SharePoint quirks with how interprets data in URL, this is just a way to avoid it entirely.