The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [best-practices]

A "best practice" is a method or process that practitioners recognize (usually through experience and research) as being more effective at getting the job done than other methods (or processes).

Filter by
Sorted by
Tagged with
35
votes
1answer
32k views

Using SPContext.Current or using static URL

There are multiple ways to work in the SP object model. The starting point for instantiating objects looks different when you look at different developers. Many times I see people doing this: SPList ...
30
votes
7answers
7k views

List of best practices on structuring SharePoint 2010 solutions

I am looking for good guidance on how to structure a SharePoint Solution including: Visual Studio Project Structure Features (how to separate features) Namespaces When to use multiple project ...
29
votes
2answers
1k views

What are some disaster recovery best practices?

What is the best way to back up SharePoint without the backup files using up all your enterprise storage? I am currently backing up SQL weekly(content dbs, config db), and doing site collection ...
26
votes
5answers
2k views

Organizing WebParts in Visual Studio - Best Practices

My team is responsible for maintaining a SharePoint 2010 site that was developed by another group. This maintenance includes updates to existing web parts (approximately 20). Currently, all of these ...
23
votes
2answers
19k views

SharePoint 2013 CSOM: Is it better to pass a Context object around or a Url?

In SharePoint 2013 CSOM is it better to pass a Context object around, or a Url to open a context? Which would be the best example: (Please consider there may be a lot of methods preforming tasks) 1)...
19
votes
1answer
4k views

Is Calling base.ItemUpdating(properties); necessary?

In an event receiver, is it necessary to call base.ItemAdding(properties);, base.ItemUpdating(properties);, etc. at the beginning of your event handler? I've seen people arguing that it isn't ...
19
votes
4answers
15k views

Best way to Impersonate in SharePoint

So far, I am aware of below 3 ways of performing impersonation in a SharePoint web part or page : Using Win32 API [DllImport("advapi32.dll", SetLastError=true)] public static extern bool LogonUser(...
12
votes
4answers
9k views

Iterating through SPListItemCollection - why foreach is bad?

I have seen in different places that we should not use foreach to iterate through SPListItemCollection, but I can't find explanation, why? E.g. http://de.slideshare.net/ghurlman/sharepoint-...
12
votes
3answers
6k views

Cross Site Collection Navigation

We are using SharePoint for our Intranet. We will have a site collection for the Intranet. Then a site collection for each department in the business. I.E. HR, IT, Finance. We are creating a custom ...
12
votes
2answers
2k views

“Best Practices” for SharePoint customizations/development to easily migrate to new SharePoint versions

Do you know of any documents that describe “best practices” for SharePoint customizations (especially custom developments) in order for these customizations/code (for example web parts, event ...
11
votes
1answer
23k views

Completely remove a WSP from SharePoint

What is the best way to completely remove a WSP from SharePoint? SO when you reinstall it again from scatch it thinks it is a clean install?
10
votes
10answers
5k views

When to use Custom Site Definitions… and not

Its an old battle between ITpro and developer. ITpros hate them due to upgrade issues, devs like the freedom it gives them without having to do house cleaning with feature stapling. What is your ...
10
votes
1answer
3k views

Best practices for creating a shared code library for SharePoint projects

I have several projects for SharePoint 2010 (mostly they are separate solutions built each to separate wsp's) in active development. And I have a similar tasks in these projects (logging, ...
10
votes
2answers
983 views

Executing a new instance of a timer job before the previously running instance has finished executing

I have a timer job that invokes a WCF service that invokes a single threaded API internally. TO ensure that my system does not fail, i want to ensure that only a single instance runs at a time. I am ...
9
votes
3answers
1k views

Customization best practices for SP2010 [closed]

We'd like to customize the look of our SharePoint 2010 pages and sites but didn't know what some best practices are: We'd like to change the look of pages some without breaking the link between them ...
9
votes
5answers
4k views

Best practices for building a SharePoint Extranet

What are the best practices when it comes to building a SharePoint Extranet? Any good resources out there? One question that I am particularly looking for some thoughts on is how to best create a ...
8
votes
3answers
15k views

When to choose web application vs SiteCollection vs Subsite?

In SharePoint you have the following types of objects: Web application (1) A container in a configuration database that stores administrative settings and entry-point URLs for site collections. (...
8
votes
4answers
4k views

URL Redirects (301/302) for Vanity/Friendly URLs

With Microsoft providing zero support when doing URL rewriting, what is my best approach for providing URL redirects? I'm not too familiar with the topic. The approach I've seen (a solution from a ...
7
votes
5answers
4k views

Saving application settings in a SharePoint application best practices

What are the best practices for saving application settings in a Sharepoint application? Would anyone save the settings in the web.config's appsettings? What about saving them in a SharePoint list? ...
7
votes
3answers
6k views

WebPart where to store a connection string

I have a webpart that connects to an external DB. I need somewhere to store the connection string. It is possible for this data source to change but would always be the same for the site collection ...
7
votes
5answers
2k views

What is the best practice for redirecting users when sites are being upgraded?

We have an upgrade to an application coming up which requires a site collection to be deleted and recreated. In terms of managing the existing users experience during upgrade what would be the best ...
7
votes
3answers
3k views

Structure of SharePoint Solution

Are their any best practices with respect to how to structure a SharePoint solution? For example we are going to develop several workflows, these will use content types and list definitions. Should ...
7
votes
2answers
279 views

Best Practice changing usernames for Sharepoint 2010

We are using SharePoint 2010 Enterprise and have a User Profile service set to synchronize against AD DS. When a user's username changes, because of marriage or mis spelling, there are a set of ...
6
votes
3answers
217 views

Things to “get right” to succesfully develop Sharepoint solutions

Lets face it, SharePoint 2010 is a big ecosystem. You need to know the GUI, the administration options, the data model, have programming skills, know the API, know how it works internally etc etc. I, ...
6
votes
4answers
5k views

Working with large external lists using BCS

I have a database that I want to display the content in SharePoint 2010. I am not displaying the content in a list but am using a custom WebPart. The database is not updated any more as it is ...
6
votes
2answers
580 views

Is it bad to dispose an object twice?

With all the focus on disposing all disposable objects in SharePoint, I wondered if there is any harm in disposing an object twice. Especially since SharePoint seems to do some disposing itself too. ...
5
votes
4answers
2k views

Can SQL be present on the same server as SharePoint 2016?

I am trying to create a VM for SharePoint 2016. Can I have both SQL and SharePoint installed on the same machine?
5
votes
3answers
2k views

Best practice to add list item in SharePoint Server OM?

from the below codes, which one is best practice and performance wise also:- CASE 1: using (SPSite oSPsite = new SPSite("http://website url/")) { using (SPWeb oSPWeb = oSPsite.OpenWeb()) { ...
5
votes
3answers
1k views

Unit testing web parts

I've read the articles from Andrew Woodward (21Apps) trying to get started with unit testing on WSS, but when I try something more advanced, like Webpart connections, I don't know how to start ...
5
votes
2answers
1k views

Instantiating SPListItems in Event Receivers - Best Practices

In the MSDN article Best Practices with Event Receivers it is clearly stated: Do not instantiate an SPWeb, SPSite, SPList, or SPListItem object within an event receiver. The article goes on to ...
5
votes
3answers
3k views

Dynamically registering JavaScript from within a sandbox web part

I am mid-way through development of a corporate intranet that will be hosted in SharePoint Online. For this reason, we are restricted to using sandbox solutions. One of the last "gotchas" that I need ...
4
votes
1answer
3k views

Can we access list from other site collection sites using javascript object model?

ECMAScript object model can only be used in SharePoint sites. So you can’t use this object model in an asp.net site to access SharePoint resources deployed in another url as this is cross-site ...
4
votes
4answers
1k views

Best practices when creating Site to use as a template

I'm creating a site that I'll eventually use as a template to create other sites from it. The site will contain lists, workflows, user groups, content types etc etc. I want to make lots of clones ...
4
votes
1answer
4k views

Search Crawling Frequency

For Search, How often should you perform an incremental crawl? I was thinking of doing it every two hours? Is that too often? Are there any best practices in terms of frequency of searching?
4
votes
2answers
1k views

SharePoint Framework: How to let modern web parts interact with each other?

How can web parts know of and interact with each other within the SharePoint Framework? Here's an example. Let's say we need: a search box web part search result web part a filter web part All ...
4
votes
1answer
371 views

Why do people prefer to use List Item Collection Enumeratror over the get_data method?

I wonder if anyone compared the two methods of handling ListItemCollection data in javascript: var enumerator = collection.getEnumerator(); while(enumerator.moveNext()) {var current = enumerator....
3
votes
3answers
2k views

Maintenance Page/Downtime

I have an IF site that will be undergoing a fairly large deployment. There will be a few hours of downtime, and I want to put a maintenance page at the front of the site, and prevent any traffic from ...
3
votes
3answers
3k views

Storing custom properties for a SharePoint Site

Let's say you are building a Project Management solution where each Project equals one site (SPWeb object). Each project has it's properties like: Project Manager, Budget, Customer, Description, ...
3
votes
1answer
8k views

PowerShell code to add/remove, install/uninstall and enable/deactivate feature at Web, Site Collection, Web Application and Farm scope

Please can you give me the best practice PowerShell code to:- A. Add, install and enable feature at -Web -Site Collection -Web Application -Farm scope B. Deactivate, Uninstall and Remove ...
3
votes
2answers
4k views

Web Application or Site Collection Architecture for My Sites in SharePoint 2013

I am designing a solution for our client which have the following 'Areas' Teams Committees My Sites Projects (MS project server) Apps I see the best approach is creating a Web Application (WA) for ...
3
votes
2answers
4k views

Best way of getting SPWeb in Event Receiver [Best Practices]

what would be the best way of getting SPWeb and List in context below, specially when list title can be different for different cultural websites, private bool doesItHaveIt(...
3
votes
2answers
1k views

(De)Commission SharePoint Database Servers

In our SharePoint Farm, We are running with 2 Database Servers and on which we have 20+ Databases.Now, due to some issues we would like to decommission the existing database servers and commission 2 ...
3
votes
2answers
191 views

What the general health checks to be performed Pre and Post patching the SharePoint servers?

What the general health checks to be performed Pre and Post patching the SharePoint servers for SP 2013? Are there any recommended best practices?
3
votes
2answers
3k views

Use SPQuery.RowLimit also on large lists with small query results?

I frequently read one should use RowLimit on SPQuerys on a large list, especially with more than 2000 items. Best Practices: Common Coding Issues When Using the SharePoint Object Model: An SPQuery ...
3
votes
2answers
689 views

Custom List - rename column “Title” or hide it then create a new dedicated column

Content Type "Item", used in Custom List, comes by default with the column "Title" in it. However in many cases, the name “Title” is meaningless to the purpose of the list. (in some cases the type of ...
3
votes
1answer
302 views

Best Practice to handle items modification in SharePoint 2007

From my understanding, there is no checkout function inside a SharePoint 2007 List. So, what is the best practice that SharePoint Professionals and Expert do to make sure that a item of a SharePoint ...
3
votes
1answer
451 views

Should this be a sandboxed solution?

My company outsourced the creation of a SharePoint WebPart for connecting to our cloud service. The WebPart connects to our service by using our REST API. When configuring the WebPart you supply ...
3
votes
0answers
1k views

Using SharePoint for an appraisal/360 process

We are thinking of using SharePoint 2010 for an appraisal/360 process. The workflow is simple. HR Create appraisal for users User fills it in Manager fills it in User accepts appraisal Manager ...
2
votes
2answers
2k views

Reason people don't use SPContext when executing web.Lists[“ListName”].GetItems(query)

I'm building a Site Definition that will be the core of a SharePoint product. I want to use best practices building the data access architecture. Since I do not know what the URL of the site will be,...
2
votes
4answers
630 views

Cache SP Objects or custom class?

Just wanted to see what the consensus on this one is… If you make a call to the OM to return a SP object e.g. SPListItemCollection, and then want to cache the results (to improve subsequent ...