Sharepoint on Premise

All things Sharepoint

SharePoint TODAY column in calculated fields and auto updating it

There has been much discussion around using a [TODAY]  column in SharePoint Lists since SharePoint Lists and Libraries have been around. Other than being able to use [Today] to set a DEFAULT value, users have always asked if they could use it in a calculated field. There are workarounds well documented in various threads that detail creating a field called “Today”, then creating a calculated field ([CalculatedToday]) that references the “Today” field, and finally removing the “Today” field in order to be able to use “[Today]” in a calculated field.

The question that follows is always, “how do I get the [CalculatedToday] to update every day or on a scheduled basis?” Again, there are numerous articles documented on the internet that suggest adding and removing a [Today] field and SharePoint will update all the [CalculatedToday] fields with the current Date. Administrators have created scripts and even timer jobs to do this automatically. This method [...]

SharePoint List ID and View ID Calculator

Simply paste the Url from the “Modify View” page in SharePoint and it will generate the List ID and View ID for you.

 

List ID:      
View ID:     

 

I got tired of doing this in notepad, so I built this as an easy way to get a SharePoint List ID or View ID from a Url.

For the list ID, go to List Settings, and copy the Url, and paste the url in the box.
For the list ID and the View ID, go to a list view, and click “Modify View,” and copy the url in the box.

Paste the url in the box and press ‘Submit’

  • 091413_0250_Funwithcust2.png
    Permalink Gallery

    Fun with custom SharePoint Ribbon buttons using the built-in image formatmap32x32.png

Fun with custom SharePoint Ribbon buttons using the built-in image formatmap32x32.png

 

While creating a new ribbon button, you will have to pick the button image.

 

This handy image is located here: http://yousite/_layouts/en/images/formatmap32x32.png

Now you will need to reference the top left corner of the image:

Open it in MS Paint and hover the top left corner of the image to get the approximate values. Each image is 32×32 pixels, so you can just start multiplying by 32 to go across and same to go down to get the exact values.

So, for example, go 448 px down and 384 px from the left

This image for the check mark

is located at Image32by32Top=”-448″
Image32by32Left=”-384″ (down at the bottom right corner)

 

 

For the formatmap16x16.png image just divide by 2.

 

Here is a portion of the Elements.xml that references the button image location:

<CommandUIDefinition
Location=”Ribbon.ListItem.Workflow.Controls._children”>

<Button
Id=”SurfPoint.SharePoint.Ribbon.NewControlInExistingGroup.Notify”

LabelText=”Approve Records to Delete”

ToolTipTitle=”Approve Records to Delete”

ToolTipDescription=”Check all records to delete then press this button after all records have been selected on this page.”

Command=”SurfPoint.Command.NewControlInExistingGroup.Notify”

Sequence=”21″

Image16by16=”/_layouts/$Resources:core,Language;/images/formatmap16x16.png”

Image16by16Top=”-48″

By |September 14th, 2013|Sharepoint on Premise|1 Comment|

Migrate a SharePoint workflow from Visual Studio 2008 to Visual Studio 2010

This is a useful article when converting a custom workflow project from Visual Studio 2008 to Visual Studio 2010:

http://blogs.msdn.com/b/bethmassi/archive/2010/01/15/migrating-a-2007-workflow-to-visual-studio-sharepoint-2010.aspx

In a nutshell,

Go ahead with the conversion wizard
Add a new Project (2010 Sequential Workflow Project) to the solution
Rename the Workflow1  folder to the new name – Very Important, you have to keep this folder in order for the workflow to be in the feature, so just rename it.
Copy the old workflow.cs file to the new folder in the new project. This will bring over the designer file and rules file (if applicable).
Delete the worflow1.cs
Copy over all other files that are not related to packaging such as Utility classes.
Copy default namespaces to new project. Check your default namespaces, namespaces in Elements.xml, assembly versions
Update namespace in new project on the .cs file, and .designer.cs file.
Compile, if does not compile, may have to remove Office reference in [...]

Debugging Custom Event Receivers – Strange Error on custom Event Receiver SharePoint 2010. .c__DisplayClass2.b__0()Object reference not set to an instance of an object.

Debugging Custom Event Receivers.

Here’s a weird error that took some time to figure out. Generic “Object reference not set to an instance of an object.” Error on a custom SharePoint 2010 event receiver. If I went through the UI to change a field on a list, the event receiver fires fine. But, if a workflow changed the field it threw the error below. I finally found if I attached the OWSTimer process to Visual Studio, it would debug, but still not show the exact problem. The solution is to find the Log On account for OWSTimer in the Services console (services.msc) and then to grant that account permissions on the list that the event receiver is running on.

Edit -checking the permissions of the OWSTimer account is just one possible solution.  What I found out was that the list was hanging on to old event receivers as well.  I had [...]

Missing All People Links in SharePoint 2010

We used this to delete users from the site collection in SharePoint 2007. It was gone in 2010, but really just “hidden.”

Simply paste the following URL into your browser and change the site name and you wll get the All People page back.  Useful for deleting users from the site collection.

http://My2010Site/_layouts/people.aspx?MembershipGroupId=0&FilterField1=ContentType&FilterValue1=Person

Hide Left Navigation in SharePoint 2010

Here’s a quick reusable way to hide the left navigation.

 Create a text file called “HideLeftNav.txt” in a document library.

 Add the following css code:
<style type=”text/css”>
/*–Hide Quick Launch –*/
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}
</style>

 
 Edit the page you want to hide the nav on, add a content editor webpart. Then, simply reference the url to the HideLeftNav.txt file and you are done.

 

How to turn off “Cannot be blank” yellow boxes on SharePoint 2010 Infopath custom list forms

 Find and make a backup copy of the Core.JS file(14templatelayoutsinc)
Edit the Core.JS file(14templatelayoutsinc)
Find the function called ErrorVisualization_ShowShortMessage
Add “return;” as the first command in the function.ErrorVisualization_ShowShortMessage(b,a,g){return;ULSrLq:;var h=g[2],d=””,e=null;if(!

 Reset IIS

 http://sharepointfeaturesandfailures.blogspot.com/2008/03/turn-off-hover-over-screen-tips-on.html

Metro Tiles in SharePoint 2010 and SharePoint 2013

Here’s a kind of fun web part I found on Codeplex. You can jump on the tiles bandwagon in SharePoint 2010. It’s packaged nicely in 2 wsp files and creates a list to hold the data. Built in images are very nice.
It’s called the Metro Grid webpart and they have done a nice job on the packaging and icons.
http://spmetrogrid.codeplex.com/

 

Notes from the Edge: SharePoint 2012 Conference, Las Vegas

Having just got home from Las Vegas, I’d like to relate some of the things I saw at the MS SharePoint 2012 conference. With over 10,000 attendees filling up the Mandalay Bay beach, I am amazed year after year of the growth. When I started working with SharePoint in 2001, who would have thought it turned into this.
Bon Jovi rocking out at Mandalay Bay for the SharePoint conference.

 Cloud everything
    You probably couldn’t go one sentence in any session without hearing cloud. What does this mean? You better get a strategy in place because it is coming fast. MS is “all in” on cloud according to Steve Ballmer. As a developer, or infrastructure professional things will change quickly. For developers it’s going to be about RESTful web services, JSON, javascript, jquery, cloud app model, Azure services, OAuth, OData and Azure services. [...]