Showing posts with label Sharepoint 2010. Show all posts
Showing posts with label Sharepoint 2010. Show all posts

Friday, February 21, 2014

Extract year from date in SPD

Create Sharepoint Workflow 2010

1. Create 2 variables, wholedate and year

2. Define functions

Set Variable:wholedate to currentitem:start time   (return field as ISOFormatted)

  then copy 4 characters from start of variable:wholedate(output to:variable:year)

  then log variable:year to the workflow history list

image

image

References:

http://weblogs.asp.net/wesleybakker/archive/2010/12/28/get-datepart-in-sharepoint-designer-workflow.aspx

Thursday, February 20, 2014

Quick Steps in Lists

Often neglected, I find this hidden feature useful for making no-code solutions.
Its a bit messy though.
image
To create, go to SPD > List > Custom Action > Choose where the button should appear. Its not completly obvious in my opinion so I’ve listed the name and where they’ll appear below.
When creating the manually from SPD, we got more alternatives than when creating a Quick Step directly from the Webgui. For example we now can add a webaddress, which can lead anywhere, either a local place on the sharepoint or somewhere offsite.
image
Examples:
ListItem – Shows on the submenu on the listitem.
image
Edit Form – Shows in the Edit Form.
image
Display Form – shows in the Display Form.
image
New Form – shows in the New Form
image
View – Shows in the List Ribbonmenu
image
From this custom actions we can also configure where the link should appear to some degree by modifying the Ribbon Location ID
image
For example, the Display Form button lands in the Manage container per default.
image
If I want to move this icon to right part of the form, I can change the .Manage. to .Actions.
 image

References:
http://blog.furuknap.net/sharepoint-2010-ribbon-locations - nice overview of where we can place our buttons.







Friday, February 14, 2014

Thursday, February 13, 2014

Using folders as metadata-masters

A handy feature to use when bulk-uploading documents to Sharepoint is the “Default Column Value”. This feature shines when using folders.

For example, say $user wants to upload 2000 images to an assetlibrary and wants to tag these with managed metadata values, 3 of them for a third of the lot and something else for the rest. Managed metavalues can’t be edited in datasheet view when using multiple values so this might take some time for $user.

In this case $user could create three folders in the assetlibrary and from Library Settings>Column Default Values > Folder  change the values as $user wants.

image

Now all documents copied to this folder, even from ExplorerView, will get these default values. Unless manually specifying something else.

The cool thing is that when the values have been set, $user can copy the images elsewhere in the documentlibrary and the metadata will still be attached. So folders can be used as a transitstation for settings metavalues. Or just be presented with a flat structure in the view.

References:

http://social.technet.microsoft.com/wiki/contents/articles/11301.sharepoint-2010-bulk-metadata-tagging.aspx

Thursday, January 23, 2014

Thumbs in Searchresults in SP2010

Was working from sharepointblogs.com instructions trying to get Thumbnails from an Assetlibrary to be displayed in an Searchresultspage, but couldnt get the thumbs to stick.

Finally I tried removing “contentypeforsearch.=’image’  frome the xsl-customizations and it started working right away. Somehow the images in my results wasn’t interpreted as images. Maybe the .jpg filetype needs to added manually or something.

In this case, its a Imagesearch result page so the results are always images.

It works, im happy. customer happy. Done.

Before:

<xsl:when test="contenttypeforsearch[. = 'Image'] and contentclass[. = 'STS_ListItem_851']">

After:

<xsl:when test="contentclass[. = 'STS_ListItem_851']">

References:

http://blogs.msdn.com/b/david/archive/2011/06/27/previewing-audio-and-videos-in-sharepoint-2010-search-results.aspx

http://www.sharepointblog.com/2010/11/image-content-type-thumbnails-in-2010.html – the moneyshot

http://www.ableblue.com/blog/archive/2008/08/30/sharepoint-image-search-part-2/ – a bit old, still generally informational.

http://www.novolocus.com/2008/05/22/showing-thumbnails-in-search/

http://blogs.technet.com/b/anneste/archive/2008/11/25/mystery-solved-crawled-properties-in-sharepoint-part-5.aspx – details regarding how the crawling properties works.

Thursday, January 16, 2014

Filtrera listvyer med localized Sharepoint

För en lokaliserad version av Sharepoint 2010 så används även svenska på de logiska funktionerna. Det är väl ok, när man kommer till ro med att det går att använda åäö på funktioner “Date=Datum,Year=År,Month=Månad etc”. Det som är knepigare att få grep och är varför de bytt ut skiljetecknen!

För att få fram en första dagen i en månad baserat på ett datumfält så funkar i Engelsk version denna:

=DATE(YEAR([Due Date]), MONTH([Due Date]), 1)
Motsvarande funktion på Svensk version:
=DATUM(ÅR(visning);Månad(visning);1)
Notera att “,” är utbytt emot “;” på svensk version. 

Så för att filtrera en listvy baserad på vilken månad som är angivet i ett fält kan följande metod användas.



  1. Skapa kolumn Visning(datumtyp)

  2. Skapa kolumn MonthEnd(beräknad) : formel =DATUM(ÅR(visning);Månad(visning);1)  output=dateimage[6]

  3. Skapa kolumn MonthStart(beräknad) : formel=DATUM(ÅR(visning);månad(visning)+1;1)-1   output=date

  4. Skapa vy,


    1. filtrera med MonthStart är mindre än eller lika med [I dag]

    2. Filtrera med MonthEnd är större än eller lika med [I dag]

imageimage


image


References:


http://iwillsharemypoint.blogspot.in/2012/03/sharepoint-list-view-of-current-month.html

http://kalsing.blogspot.in/2006/02/sharepoint-list-group-by-month.html

http://blog.pentalogic.net/2009/11/howto-filter-items-current-calendar-month-view-sharepoint/

Friday, January 10, 2014

Tiny calender in SP 2010

Customer want a small calenderview. Like the one in Outlook.image

This can be achived using all built in tools with some css tinkering.

You need:

  • A calenderlist using a calenderbased view
  • A content editor web part

Steps:

  1. Insert webpart using calenderview
  2. Insert webpart content editor webpart (CEWP)
  3. Edit CEWP

<style>
.ms-acal-header TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TD {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv TH {
    VERTICAL-ALIGN: top
}
.ms-acal-rootdiv {
    OVERFLOW: hidden; FLOAT: right; MARGIN-LEFT: 0px
}
.ms-acal-vitem {
    VISIBILITY: hidden; BACKGROUND-COLOR: #f2f2f2
}
.ms-acal-month-weeksel {
    WIDTH: 5px; VISIBILITY: hidden
}
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
}
.ms-acal-month-top {
    WIDTH: 20px; BORDER-BOTTOM: #b6c5c6 1px solid; COLOR: #919649; PADDING-BOTTOM: 2px; TEXT-ALIGN: center; PADDING-TOP: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px
}
.ms-acal-summary-dayrow TH {
    CURSOR: pointer; BORDER-TOP: #b6c5c6 0px solid; HEIGHT: 0em; BORDER-RIGHT: #b6c5c6 0px solid; BORDER-BOTTOM: #b6c5c6 0px solid; BORDER-LEFT: #b6c5c6 0px solid; VISIBILITY: hidden; BACKGROUND-COLOR: #ced8d9
}
.ms-acal-summary-itemrow TD DIV {
    HEIGHT: 0px; WIDTH: 0px
}
.ms-acal-vlink IMG {
    VISIBILITY: hidden; MARGIN-RIGHT: 3px
}
.ms-acal-vlink A:hover {
   
}</style>

4. Save

Now this view will expand the row if there is an item on that week. Not so pretty, but itll work for this case.

  • Onhover on date the events of that day should be displayed
  • Date should be bold or different color if their is events on that day.

image

References:

http://www.sharepointgrind.com/Lists/Posts/Post.aspx?ID=19

http://blog.pathtosharepoint.com/2008/10/06/tiny-sharepoint-calendar-1/

http://erikswenson.blogspot.se/2013/04/small-calendar-for-sharepoint-2010-2013.html

Monday, November 04, 2013

Error when creating document from sharepoint

Symtoms: Suddenly when trying to create new document from a sharepointlist the following message is presented instead of a new document:
image
“The Operating system is not presently configure to run this application”
Followed by another error with bull about rights and such.
Solution:
When searching the net for this error some indicators point to Office 2013 to be the culprit. Though I’m running Office 2010, I’ve installed Visio 2013. Can this be the the error?
When installing hotfix kb2726997 the error disappears. Solved. Link below.

Edit 131217: This can also happen if Sharepoint Designer 2013 is installed together with Office 2010.

References:
http://support.microsoft.com/kb/2726997/en-us

Thursday, October 24, 2013

Preserve (some) document properties

There are some properties that’s usually already bundled with your documents. Like maybe the title, author, comments and categories. Ok, usually only author and title but still.

To get pull these values along when adding a document to a document library you can add the following columns (line text)

_Commentimage

_Status

_Categories

_Author

 

Neat thing is that these properties works both ways. Edit the columns in SP and it shows up in the document properties.

 

 

 

 

References:

http://sharepoint.stackexchange.com/questions/64689/word-document-author-property-as-sharepoint-column-how

http://social.technet.microsoft.com/Forums/sharepoint/en-US/00b648dc-6b9b-420d-b9eb-6ac095f6f5b2/core-document-columns-author-and-date-created?forum=sharepointgeneralprevious

Wednesday, October 23, 2013

Check installation type

Its relevant to know what kind of installation a sharepoint server is.

For example User Profile Synchronization service is not supported in a Single Server installation, which is sort of relevant to know if troubleshooting a issue like that.

To check this on the local server:

  • SharePoint 2007: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\ServerRole
  • SharePoint 2010: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\ServerRole
  • SharePoint 2013: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\ServerRole

Value can be:

  • SINGLESERVER – means this is a standalone / single server installation
  • APPLICATION – means this is an application server on a full farm installation (could also include the web front end role as well if multiple roles are used)
  • WFE – means this is a web front-end server on a full farm installation

image

References:

http://nickhobbs.wordpress.com/2013/05/18/sharepoint-how-to-check-the-sharepoint-installation-type-standalone-or-farm/

Monday, April 29, 2013

Strange group by problem

A curious problem.
Environment : Sharepoint Foundation 2010 using localization on Server 2008 R2
Symptom: After migration of Sharepointsite to different host problems started occur with the Group By function in all Views that utilized this.
First time a group by view is expanded everything works, but after opening a document under a group by node all the nodes reloaded and after this no + or – does what it should. Everything just shows as “Loading” under the Group By nodes. The Ribbonmenu also get stuck on “Loading” after this has started occuring. Reload of entire site doesn’t do anything. Browsing in InPrivate node gets in rolling once, then same error again.
image
Solution: Install kb2353117
References:
http://support.microsoft.com/kb/2553117/en-us

Tuesday, March 19, 2013

Infopath calculate time difference between two inputs

Need to get the number of hours between two timeinputs in infopath. This will always be on the same day.
60 * (substring(laterTime, 12, 2) - substring(earlierTime, 12, 2)) + (substring(laterTime, 15, 2) - substring(earlierTime, 15, 2)) + (substring(laterTime, 18, 2) - substring(earlierTime, 18, 2)) div 60
When pasting this to a field in infopath, we first need to remap latertime and earliertime to relevant fields in our own form. When trying to verify the formula it throws an error stating a missing ,
Upon closer examination of the xpath values we notice than an extra . is in place where the , should be .
image
When the dots are are replaced with commas the code works as it should.
References:
http://www.infopathdev.com/forums/p/20732/71795.aspx

Monday, February 25, 2013

SQL Agent doesn’t start

SQL Agent won’t start for SQL Server 2008 R2. Everything else works.

Symptoms:

When trying to start the SQL Server Agent service, either from the service.msc or the Management Studio error “Unable to start SQLAgent” is given.

image

Actions:

Check output from sqlagent.out. To change the path of sqlagent.out

use msdb

go

sp_set_sqlagent_properties @errorlog_file='c:\temp\sqlagent.out'

go

Following message in sqlagent.out:

---- - ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object 'sp_sqlagent_has_server_access', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (ConnIsLoginSysAdmin)

Resolution:

Added the SQL Agent service account as sysadmin on the sql server from Securites.

image

References:

http://codespin.blogspot.se/2008/01/fixing-startup-failure-of-sql-server.html

http://qa.social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/542bab08-c8a6-4106-ae96-99bf0f895bd8

Thursday, February 21, 2013

Sharepoint search returns property doesn’t exist

This error can occur if refinement calls for values that doesn’t exist in the search services Managed Properties.

When search has been executed, edit page and edit the Refinement Panel webpart property  imageunder Refinement>Filter Category Definition

Below is the standard output on a unedited. Compare to your values and see what differs.

<?xml version="1.0" encoding="utf-8"?><FilterCategories> <Category Title="Result Type" Description="The file extension of the item" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="0" SortBy="Frequency" SortDirection="Descending" SortByForMoreFilters="Name" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="FileExtension" MoreLinkText="show more" LessLinkText="show fewer"> <CustomFilters MappingType="ValueMapping" DataType="String" ValueReference="Absolute" ShowAllInMore="False"> <CustomFilter CustomValue="Adobe PDF"> <OriginalValue>pdf</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Email"> <OriginalValue>eml</OriginalValue> <OriginalValue>msg</OriginalValue> <OriginalValue>exch</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Excel"> <OriginalValue>odc</OriginalValue> <OriginalValue>ods</OriginalValue> <OriginalValue>xls</OriginalValue> <OriginalValue>xlsb</OriginalValue> <OriginalValue>xlsm</OriginalValue> <OriginalValue>xlsx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Image"> <OriginalValue>tif</OriginalValue> <OriginalValue>tiff</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Lotus Notes"> <OriginalValue>nsf</OriginalValue> </CustomFilter> <CustomFilter CustomValue="OneNote"> <OriginalValue>one</OriginalValue> </CustomFilter> <CustomFilter CustomValue="PowerPoint"> <OriginalValue>odp</OriginalValue> <OriginalValue>ppt</OriginalValue> <OriginalValue>pptm</OriginalValue> <OriginalValue>pptx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Publisher"> <OriginalValue>pub</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Text"> <OriginalValue>odt</OriginalValue> <OriginalValue>txt</OriginalValue> <OriginalValue>url</OriginalValue> <OriginalValue>csv</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Visio"> <OriginalValue>vdw</OriginalValue> <OriginalValue>vdx</OriginalValue> <OriginalValue>vsd</OriginalValue> <OriginalValue>vss</OriginalValue> <OriginalValue>vst</OriginalValue> <OriginalValue>vsx</OriginalValue> <OriginalValue>vtx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Webpage"> <OriginalValue>ascx</OriginalValue> <OriginalValue>asp</OriginalValue> <OriginalValue>aspx</OriginalValue> <OriginalValue>htm</OriginalValue> <OriginalValue>html</OriginalValue> <OriginalValue>jhtml</OriginalValue> <OriginalValue>js</OriginalValue> <OriginalValue>mht</OriginalValue> <OriginalValue>mhtml</OriginalValue> <OriginalValue>mspx</OriginalValue> <OriginalValue>php</OriginalValue> <OriginalValue></OriginalValue> </CustomFilter> <CustomFilter CustomValue="XML"> <OriginalValue>xml</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Word"> <OriginalValue>doc</OriginalValue> <OriginalValue>docm</OriginalValue> <OriginalValue>docx</OriginalValue> <OriginalValue>dot</OriginalValue> <OriginalValue>nws</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Zip"> <OriginalValue>zip</OriginalValue> </CustomFilter> </CustomFilters> </Category> <Category Title="Site" Description="Which site this document is from" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="SiteName" MoreLinkText="show more" LessLinkText="show fewer" /> <Category Title="Author" Description="Use this filter to restrict results authored by a specific author" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="Author" MoreLinkText="show more" LessLinkText="show fewer" /> <Category Title="Modified Date" Description="When the item was last updated" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="6" MaxNumberOfFilters="0" SortBy="Custom" ShowMoreLink="True" MappedProperty="Write" MoreLinkText="show more" LessLinkText="show fewer" > <CustomFilters MappingType="RangeMapping" DataType="Date" ValueReference="Relative" ShowAllInMore="False"> <CustomFilter CustomValue="Past 24 Hours"> <OriginalValue>-1..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Week"> <OriginalValue>-7..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Month"> <OriginalValue>-30..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Six Months"> <OriginalValue>-183..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Year"> <OriginalValue>-365..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Earlier"> <OriginalValue>..-365</OriginalValue> </CustomFilter> </CustomFilters> </Category><Category Title="Enhet" Description="Enheter" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="3" NumberOfFiltersToDisplay="3" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="Enhet" MoreLinkText="show more" LessLinkText="show fewer" /></FilterCategories>

Wednesday, February 20, 2013

Search doesn’t work

Al too common issue is that searchfunction i Sharepoint blows a fuse for unclear reasons.

Usually when migrating sites from one server to another.

Following situation has occurred with Search Server 2010 Express & Sharepoint Foundation 2010 and Sharepoint Server 2013.

Symptoms:

  • Search returns “property doesn't exist or is used in a manner inconsistent with schema settings” clip_image001
  • Search throws an exception “Internal server error exception” clip_image002
  • Search just doesn’t find anything

This usually fixes it.

  1. Create new page based on Enterprise template Basic Search Page. Give it a good name like intranet.com/searchcenter/
  2. Try it if the search works there.
  3. If it does map the main searchfunction to this new searchcenter instead.
    1. Site Collection Administration> Search Settings
    2.  clip_image003
    3. Change Search Center Url to /searchcenter/ and change results page url to the one you got when you search from the searchcenter. Usually results.aspx if someone hasn’t been fiddling.

If the Search Service Application shows any funny business, like not being able to resolve user names. Its usually better to create a new SearchService.

What to think about when creating a new Search Service:

1. Make sure to use an account that has full dbo to the contentdatabases.

2. Make a full crawl after its created, make sure that your sites are listed in the “Content Source>Local Sharepoint Sites” settings in the SearchService Application. It usually is.

3. Edit Web Application Service Connection to make sure that the new Search Service Application is associated. Remove the old one.

Thursday, February 14, 2013

Workflows doesn’t autostart

still in Sharepoint 2013, the same issue. Though I’ve enabled mailto function on a list the workflows doesn’t start when new item is created.

Check if its activated

1. stsadm –o getproperty –pn declarativeworkflowautostartonemailenabled

If this shows : <Property Exist=”No” />

Run

2. stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true

Then try mailing the list again and the workflow should kick in.

References:

http://www.go4answers.com/Example/start-workflow-incoming-mail-sharepoint-163314.aspx?utm_source=twitterfeed&utm_medium=twitter

Wednesday, February 06, 2013

Powershell on Sharepoint server bonkers

If sharepoints powerhell starts with ”the local farm is not accessible. Cmdlets with featuredependencyid are not registered.”
clip_image001
This could be cause for some reason the wrong powershell version starts up.
Try running />powershell –version 2
If need be to add sharepoint modules, use following:
/> add-ps-snapin Microsoft.sharepoint.powershell




Thursday, April 19, 2012

Error while accessing datasheet-view in SP2010

Some of our customers have run into a problem while trying to access datasheet view of a list when using Office 2010 64bits version.
 clip_image002
A common solution to this is to install the 2007 Office System Driver: Data Connectivity Components (x32).
Link to download: http://www.microsoft.com/downloads/en/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
Link to MS information: http://support.microsoft.com/kb/2266203
Technorati-taggar: ,

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...