?
Solved

SPO Open List from Other List in Dialog with Filter

Posted on 2016-10-27
3
Medium Priority
?
82 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
Walter Curtis earned 2000 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 19

Expert Comment

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

765 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