How to Build a SharePoint 2012 Server Farm on a single server by utilizing local accounts

SharePoint 2010 could be easily deployed into a single box having local administrator providers utilizing the separate, out-of-the-box set up, but this particular forces you to have SQL Express 08 (which includes SharePoint). What happens if you should do an entire farm install for the box, however stay with local providers? Then that turns into a much more difficult.

The entire install, utilizing the settings dialogs, never will allow you to enter local providers, and can force you to have a website account. The very best practice appears to be to market the server into a domain control, and make use of domain providers, however this may not possible be possible or preferred if you are doing work in the DMZ, or perhaps on the development device. Additionally, you may want to the actual complete install to enable you to leverage the 10GB data limit and also remote BLOB storage space in SQL 08 Show R2, instead of being stuck for the earlier version connected with SQL Express that includes SharePoint. Fortunately, there’s several methods to bypass the area account requirement by utilizing PowerShell scripting to build environmental surroundings. I discovered two helpful blogs below which enable you to get section of the way now there, and I will help clarify a few of the missing items.
Continue reading

How To Fix SharePoint 2010 Event Log Error 7043 TaxonomyPicker.ascx

After some additionally Internet sleuthing it would appear that the control “TaxonomyPicker. ascx” isn’t basically required – ıt had been left in unexpectedly from release. When SharePoint internet websites start they on auto-pilot compile and cache controls from the “/_controltemplates” folder (default position is C: \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES), consisting of the TaxonomyPicker. ascx management. The controls are checked up against the SharePoint DLLs (Microsoft. SharePoint. Portal for example), and thus the error that is certainly raised is actually considering that the control entry isn’t going to exist in this SharePoint DLLs. Hence the presentation log is basically saying “I produce an. ascx file it does not have a matching entry from the SharePoint DLLs”.

Continue reading

HOWTO: use SharePoint Feature function to Activate and Deactivate Custom SharePoint Master page

Beneath example shows how to only arranged the Master page Url although not the custom grasp page URL. thus Layout pages is going to be same after a person deploy the grasp page. You may also change the Customized master page WEB ADDRESS also.

Feature Activation

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb web = properties.Feature.Parent as SPWeb;

string urlMaster;
string urlCustom;

if (@"/".Equals(web.ServerRelativeUrl))
{
urlMaster = @"/_catalogs/masterpage/BLLICT.master";
urlCustom = @"/_catalogs/masterpage/v4.master";
}
else {
urlMaster = string.Concat(web.ServerRelativeUrl , @"/_catalogs/masterpage/BLLICT.master");
urlCustom = string.Concat(web.ServerRelativeUrl , @"/_catalogs/masterpage/v4.master");
}

web.MasterUrl = urlMaster;
web.CustomMasterUrl = urlCustom;

web.Update();

}

Feature Deactivation (Reverse to Original Master)

public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPWeb web = properties.Feature.Parent as SPWeb;
string urlCustom;

if (@"/".Equals(web.ServerRelativeUrl))
{
urlCustom = @"/_catalogs/masterpage/v4.master";
}
else
{
urlCustom = string.Concat(web.ServerRelativeUrl, @"/_catalogs/masterpage/v4.master");
}

web.MasterUrl = urlCustom;
web.CustomMasterUrl = urlCustom;

web.Update();
}

Continue reading

How to really disable event firing in sharepoint

One of the things I found out the hard way while programming event handlers in sharepoint is that you have to wrap your update() or delete() functions with the disableeventfiring function individually, for example:

this will work:
base.DisableEventFiring();
item.update();
base.EnableEventFiring();

this will NOT work:
base.DisableEventFiring();
item.update();
item.delete();
base.EnableEventFiring();

So the moral of the story is, only do one event triggering action at a time, do not try to do 2 or more within one wrapper.

How to add or remove permissions to a list item in sharepoint

Ok here is how I add or remove or copy permissions to a list item in sharepoint:

1 if (properties.ListTitle.Equals(“Document Library”))
2 {
3 using (SPWeb objWeb = properties.OpenWeb())
4 {
5 SPListItem d_item = properties.ListItem; //this is the one I want to copy permission from
6 SPRoleAssignmentCollection roles = d_item.RoleAssignments;
7 SPListItem item = myFile.Item; //this is the one I want to copy permission to
8 item.BreakRoleInheritance(true); //you must set this to true or it wouldn’t work
9 while (item.RoleAssignments.Count > 0)
10 {
11 item.RoleAssignments.Remove(0);
12 }
13 foreach (SPRoleAssignment role in roles)
14 {
15 item.RoleAssignments.Add(role);
16 }
17 base.DisableEventFiring();
18 item.Update();
19 base.EnableEventFiring();
20 }
21 }

How to customize the item edit form in sharepoint designer

I needed to customize the item edit / display / new form to remove some fields from the form. In SPD you can not convert the edit form to XSLT dataview. What you have to do is:

1. Hide the default form: Select the ListFormWebPart, right click and select web part properties. Go to layout and check hidden.
2. Insert your custom form: Click on an empty area so nothing is selected. Then go to Insert->Sharepoint controls->Custom List form, then select the list you are modifying and select the type of form. Now you can modify or delete any field!

How to Add, Remove, Manage List Columns in SharePoint Designer

To Add/Remove/Manage columns in sharepoint designer(SPD), first open up the site in SPD then open up the view’s aspx file. In design mode, right click on the DataFormWebPart and select “convert to XLST data view”.

Now you should have a “Common data view tasks” popup, if not, just click on the arrow to the right. You could then select “edit columns”. Now you will be able to add/remove/manage columns in SPD! Save the file when you done and your sharepoint site will be automatically updated with the new columns.

Int32.Parse Versus Convert.ToInt32 in SharePoint

Today I found out the hard way that SharePoint doesn’t like the function Int32.Parse. I spent several hours trying to debug my code, then finally come to the conclusion that by using Int32.Parse to convert a int to string, it mysteriously prevents execution of everything that follows this line (although this compiles perfectly in VS2008).

The SharePoint correct way to convert int to string is to use the function Convert.ToInt32(myString), btw Convert is also faster than Parse, so I recommend everyone to stop using Parse and use Convert instead even if it is not sharepoint.

Sharepoint Document Library Mass Upload Tool

This is a tool written by Stuart Preston to enable us to mass upload files, folders and sub-folders into our sharepoint document library. The tool will automatically create the folders in sharepoint. There is no limit on the number of documents you could upload.

Download SPBulkUpload

How to use:
1. Extract the zip file, this is actually a Visual Studios project with source code.
2. To start using the tool, copy the Conchango.Sharepoint.Utilities.BulkUpload.exe file from /bin/Debug folder to your C:\ root folder and rename it to something shorter like “spbulk.exe”.
3. Open up command prompt (Start->Run->cmd)
4. type: C: to go to your C:\ root
5. type: spbulk “c:\source folder” “http://webapp/site/target/document_library”
(replace the source folder and destination with your actual folder and site url)
6. Wait for the tool to finish.

To show file extension in sharepoint document library

1. Open up the .aspx file responsible for displaying the document list in Sharepoint Designer, in my case it is called AllItems.aspx

2. Select the WebPartPages:ListViewWebPart control. (It is the place where rows of document are listed)

3. Right-click on it, Convert to XSLT Data View

4. Go into the code and find the line that says:

<xsl:value-of select="ddwrt:UrlBaseName(string(@LinkFilename))" />

5. Add this to the end of the line:

.<xsl:value-of select="@File_x0020_Type" />

6. Save

Caution: after editing the file with sharepoint designer, you wouldn’t be able to edit it with anything else except maybe Visual Studio