Solved

SPO Open List from Other List in Dialog with Filter

Posted on 2016-10-27
3
50 Views
Last Modified: 2016-10-28
Working with SharePoint Online/365, I want to open a SharePoint list from another list on field click. I can get the list in a dialog with the following:

function openDialog(myProject) {  
   SP.UI.ModalDialog.showModalDialog(   
     {  
       url: "https://mysite.sharepoint.com/sites/develop_apps/Lists/ProjectCommunications/AllItems.aspx",
       width: 1000,
       title: "Project Communications"  
     }  
   );  
 }

Open in new window


This works great. But how can I open that list filtered? I've tried:

function openDialog(myProject) {  
   SP.UI.ModalDialog.showModalDialog(   
     {  
       url: "https://mysite.sharepoint.com/sites/develop_apps/Lists/ProjectCommunications/AllItems.aspx#FilterField1%3DProject-FilterValue1%3D" + myProject,
       width: 1000,
       title: "Project Communications"  
     }  
   );  
 }

Open in new window


but that gives me "no items to show"

What is the correct way to filter via URL, if possible?
0
Comment
Question by:Michael Vasilevsky
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Walter Curtis earned 500 total points
ID: 41864033
I don't think this will help because it is from SharePoint on premise, but maybe.

I have never used the string as you have it:

AllItems.aspx#FilterField1%3DProject-FilterValue1%3D" + myProject,

which is not to say it is wrong, just something I have never seen.

In most of my situations, I am using a relational list and I go to one of the form pages such as display or edit, however it should work too with allitems. The string would be very simply such as this;

/display.aspx?ID=123

That would open the display form for the item with the ID from the string.

Hope that helps...
0
 
LVL 10

Author Comment

by:Michael Vasilevsky
ID: 41864242
0
 
LVL 16

Expert Comment

by:Walter Curtis
ID: 41864258
Glad you got it working. Thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question