One custom display form for all the lists - sharepoint

Good day to you. I am newbie in SharePoint 2013 so please bear with me. I have created around 15 lists in my website each containing same columns but different data (they differ semantically).
I am aware that we can change the default view, edit and display form for each list by creating new form in SharePoint Designer 2013. This seems like a very bad approach as far as the maintenance is concerned. I know my lists are exactly the same so why do I have to create same 15 display forms for each of the lists?
Is there a way to create one custom Display form (may be in a central location, i don't know i am just thinking :P ) for all the lists? Is there a way to tell a list to use a specific display form? Any help will be highly appreciated. Thanks.

If i understand your question correctly, you have 15 lists with same set of columns. You want to change the display/look of the form. All 15 lists should have same look and feel right!! If yes, then why don't you try with some html, javascript solution. Since you are in sharepoint 2013, javascript support for solutions is very good like rest queries. You can use SPServices also.
If you want to to add data to the list whenever you click on the "New Item" link in the list then hijack this link such that it should navigate to your custom form. Pass your list name as query parameter. Whenever user is saving the form, get the list name from the query parameter and save the data to that list.
There could be another ways also to achieve the solution with html and javascript.
Useful links:
Microsoft, Microsoft, SPServices

Sam I think you can create a custom content type and create custom display form for your content type. Enable the content type in each of your lists so automatically this customized form would be available.
The advantage of this approach is that suppose if you need one more list after some time you can just add this content type and your form would be available into the new list as well.
The approach is explained in the link below.
http://blogs.msdn.com/b/varun_malhotra/archive/2009/06/06/define-custom-new-edit-display-forms-for-content-types.aspx
Check this one also
https://joshmccarty.com/2011/02/sharepoint-custom-list-with-custom-content-types-and-custom-display-forms/

Just wanted to write the solution which I implemented as it might help others as well. (Thanks Hiren and Mihir for your valuable inputs)
I had 15 lists and I was showing the data to the user using content search web part with custom display template. All of the lists were using the same display template so I made a new page just to show the item details. In the display template I pointed the item URL (i hijacked the list name and the current item id) to my new page and displayed the item. Let me know if anyone is interested in the whole solution or further elaboration is required.

Related

Pulling two different sets of data from the same document library in a single page SharePoint 2013

I have a document library set up with multiple different categories of document, and I'm using a metadata column to differentiate between them.
I want to be able to display two different document library web part on a page for different categories of file side by side. This is simple for one category, I just set up a list view filtered by the metadata column, but when I add a second web part alongside the first, it breaks the first one.
I have no idea why this is happening, but it seems like SharePoint isn't happy with pulling two sets of data from the same document library.
When I am editing the web parts, I can get them to both display the documents I want, but then when I click save, the first web part empties.
Not sure what other information would be useful for diagnosing or helping with the problem, so if I haven't given enough detail let me know. I am familiar with SPD as well as developing through the web interface, so if this needs a more complex solution that's fine with me!
Having spent some more time playing around with this, it struck me that I could probably achieve what I wanted using something other than a Document web part, and I was right.
Instead of using the somewhat inflexible document web part, I created a content query web part which only searched within the document library from my site, and filtered by the metadata column.
This way I can create as many queries as I like and they don't interact with each other in weird ways. It also has the advantage of being significantly easier to customise the output without needing to resort to SharePoint Designer.
Content Queries are the answer!

SharePoint 2013 KnockoutJS Lookup columns

I have a basic knockoutjs project loading data from a SharePoint 2013 list scenario. Getting data and displaying data is easy, the problem that I'm running into is on the edit mode displaying the proper control. Everything should not be a textbox. This means the people picker control to dropdownmenus to calendar controls.
MSFT has some pretty good documentation on using the client side people picker control here"http://msdn.microsoft.com/en-us/library/office/jj713593.aspx
The problem that I have is calling this control inside my viewmodel.
Setting the value of the control doesn't look difficult courtesy of this blog post: http://www.sharepointcolumn.com/sp2013-setting-people-picker-value-in-newform-aspx/
I attempted to looking into computed values, but that doesn't seem to work. Does anyone have a blog post that I skipped over? The closest related post that I can find: http://yetanothersharepointblog.wordpress.com/2012/12/11/working-with-sharepoint-lookup-columns-in-knockout-js/
Lastly since it seems that I'm the only one doing this, does anyone think that I should not be reinventing the wheel with my forms and should just link each item to the appropriate SharePoint list item in edit or display view? I suppose that would be easier.
From a SharePoint Professional to another, I would highly recommend you to do that.
Just redirect the user to the item edit/display item page an let SharePoint take the leash of how to handle UI form elements.
Because, assume that you implement your custom form, what if the user decides to add one more site column to the list? Will you update your code to support another field?
From my personal experience with the beast I've come to the conclusion that structural implementation over already existent functionality tends to go wrong.
Also, if you have some kind of listing of items custom made and you want to provide editing, try to do something opening a pretty SP.UI.ModalDialog, its elegant and you use the sharepoint to do the work for you.
But it's just an advise.

Sharepoint 2010 - Datasheet view and 3 linked lists

I've got a tricky situation I'm trying to determine the best way to solve. I'm a VS developer who is learning SharePoint so it's a little frustrating to me when what I am trying to accomplish could easily be done with code and a db.
I have three lists, a parent and two children list that are linked through lookup columns. The client actually wanted everything in one list but due to SharePoint column type limitations I had to split the data into the three lists, there are over 300 fields. The client wants to see all the lists together in one view and be able to filter and edit groups of items.
I have successfully created a new data source linking the lists and can display that on one of my pages to view. After some research however I have learned that I can't create a datasheet view from this linked view due to limitations in the Office componets that SP uses. Which makes sense.
The business need is for the client to filter the three lists based on criteria they select from either list A AND list B and list C to get a group of items, they make the updates and save the changes back to the 3 lists. They prefer to do this in datasheet view because this mimics the excel spreadsheet that they are currently using that this website will replace. They will potentially be updating between 1-30 items at a time using this, which is why they prefer the drag and copy functionality.
I was thinking of two options: trying to create some kind of custom web part that has a gridview of all the columns in edit mode that they can filter down to their items and make their changes. Then I would have to loop through the fields and make updates programmatically. I also saw on this site jQuery.sheet, that looks like it may be a good solution if I go this route instead of gridview.
Or have a modal window with the columns listed, have the user select what they want to filter to, then redirect to a page that shows the three lists in their own DSVs. The user would have to make updates in the three separate views. Then I would use workflows to synchronize the lists after they had made their changes.
I always end up trying to do things programmatically since I am still largely unfamiliar with SP and only seem to hit its limitations instead of its strengths. Has anyone tried to do something similar to this? Or do you have any suggestions as to the best way to accomplish this? Best practices? I appreciate all thoughts and comments! FYI I've also posted this on the MS SP forums as well to cast a wider net...
Thanks,
Sabrina
In this case, you are better off going with a custom solution. A webpart would be an excellent choice for delivering your custom interface.
A dataview webpart will do the job, but if you feel comfortable with the jQuery solution it would make for a nicer interface.
In your code, treat the lists as you would a database and isolate it from the logic and interface code within the webpart.

Multiple Sharepoint Forms

I am trying to split out what I originally wanted in a single form. The downside was that I wanted to keep multiple lists and I found that I could not use a single form with multiple lists.
What I am trying to do is to keep my customer information in a separate list/form so I can re-use it in a different application as well.
What I would like to do is give a picker to pick the customer from a list, and if the customer is not listed to allow the creation of a new one.
What I am wondering is how I can leave the main form, create the new customer, and then return to the main form but with the new customer information passed to the new form as selected. In ASP.NET one of the ways I would do this is through the querystring, but I am not sure if that is doable or preferred in Sharepoint.
Any thoughts or links to tutorials would be great.
Please keep in mind that due to access/security limitations I am trying to do this strictly through the browser and Sharepoint Designer.
Thanks!
With your access limitations, I don't see a solution that will allow the refresh of the original form to get the new data. You may be able to hack in some JQuery stuff to do this, but I just don't see it being an easy/value-for-time thing to do.
You may just have to allow the form user to save the form without customer info and come back to it.
A list view can then highlight forms with no customer info. This all depends on the usage scenario.
You can use the Source query string parameter to get you back to the original form after completing the new customer form. However, unless you add some code (either javascript or server side) you won't get the id of the new customer.
The best option is probably using jquery and the sharepoint web services. It's quite easy if you start with the right scripts, and you can do something like your original plan - make a simple form in a jquery ui popup.
You can also use javascript to manage linking between multiple forms, but you need to be careful about clearing out already entered form data.
Another option would be to edit dispform.aspx and add dataviews for other lists, along with appropriate add buttons, and add javascript to the new customer form that sets the value of a connecting lookup field. However, that tends to require quite a bit of messing about with list guids and other undocumented bits.

How to tie a dropdown list to a gridview in Sharepoint 2007?

This should be a really really simple thing, but for some reason it is just eluding me.
I want a Sharepoint page which will have a drop down list that is tied to a database lookup table.
When an item is selected and they click a GO button, I want it to update a gridview that is also on the page.
I'm looking for a simple how to - while assuming I'm a sharepoint idiot. BTW, I am using the Microsoft Office Sharepoint Designer.
Thanks,
Edit:
My need is actually very simple. I want to filter the results of a query using a drop down list. This used to be called a master - detail relationship.
For example, my regular data has school name, application name, and how long the application was running. Because there could be a hundred applications per school and there are 60+ schools, I only want to show one schools information at a time.
So, I want to put a drop down list at the top of the screen which contains the list of schools. When one is selected, the gridview should be updated to reflect the new schools information.
Chris.
I currently use a drop down tied to one sharepoint list to filter a dataview of another sharepoint List.
The instructions are here:
http://blogs.msdn.com/sharepointdesigner/archive/2007/03/05/asp-net-controls-filter-the-data-view.aspx
I'm not exactly sure of the specific needs here, but it seems that you are trying to stretch a bit beyond what Sharepoint Designer is well suited to. To look up data, you do have access via the dataview web part, which is here:
http://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx
However your filtering needs may prevent you from using this. If you want to do it .net without knowing too much about MOSS, you can use the "son of smartpart" (google it) which allows you to host standard .net user controls in webparts.
Hope this helps!

Resources