Freitag, 16. November 2012

Hide the title column in a custom content type

One of the problem which I had most of the time when I tried to create a custom content type was "How can I hide title column in my custom conten type?"

The Solution is very easy. You must break the Inherits from item and add RemoveFieldRef to your content type definition :-).

Hier is a code example which can you use as an example for you:

<pre class="brush: xml">// Comment
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x01006ffb64509c2341d2bff13b98859f792b" Name="MyTestCT" Description="My Content Type" Inherits="FALSE" Version="0">
    <FieldRefs>
      <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" />
      <FieldRef ID="{38B8C4D9-6048-44A3-A092-BB11DD7F6861}"  Name="MyNewfield" Required="TRUE"></FieldRef>
    </FieldRefs>
  </ContentType>
  <Field ID="{38B8C4D9-6048-44A3-A092-BB11DD7F6861}" Name="MyNewfield" Group="My Cloumns" DisplayName="My New Field" Description="My New Field" Type="Text" Required="TRUE"/> 
</Elements>
</pre>

Dienstag, 6. November 2012

Debugging InfoPath 2010


For my client, I am currently developing a solution in SharePoint 2010 Enterprise Edition based upon InfoPath 2010 and Nintex Workflow 2010.

Because the InfoPath 2010 Form contains a C# based Code Behind File, it must be published using SharePoint 2010’s Central Administration Site.  However, this form of deployment an create debugging problems, because many of the errors that are logged in by SharePoint in the United Logging Service (ULS) cannot be mapped directly to specific lines or functions that exist in the InfoPath 2010 Form code that are actually causing the errors. =(

Thankfully, Nik Patel has written an excellent step-by-step article describing how to setup and configure debugging for InfoPath 2010 Forms using Visual Studio 2010. After I followed these instructions I was able to debug my InfoPath forms project properly, and complete my project with a smile! =)

Montag, 22. Oktober 2012

Debugging SharePoint 2010

Turning off custom errors in _layouts Web.Config for debugging mode in SharePoint 2010


As a developer, one of the first things I do after I have setup a web application & site collection is:
Open the web.config (“C:\inetpub\wwwroot\wss\VirtualDirectories\<port>”) and set:

- Debug=”true” instead of the default of Debug=”false” (I do a find on “debug” in Visual Studio)
- CallStack=”true” instead of the default of CallStack=”false” (I do a find on “callstack” in Visual Studio)
- CustomErrors=”Off” instead of the default of CustomErrors=”On” (I do a find on “CustomErrors” in Visual Studio)
I would have expected this to be enough to catch all errors but when I tried to delete a content type that was probably in use, instead of getting the detailed message I was expecting, I ended up getting the infamous message telling me to change the customerrors setting in the web.config so that I can see the details:

Server Error in '/' Application.

--------------------------------------------------------------------------------
Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

image

As a refresher to anyone else that is running into this problem, there is another web.config in the _layouts directory (“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14”) where you need to turn the customErrors to be “Off”:

SharePoint 2013 Certification

SharePoint 2013 is now in beta version available. The first release is planned for the first Quarter 2013. You can now plan your MCSE certificate for this version of SharePoint.

 
A detailed description of roadmap can be find here on Microsoft learing page.


Freitag, 10. August 2012

The type or namespace name ‘LayoutsPageBase’ does not exist


After creating an empty SharePoint 2010 solution in Visual Studio 2010 I added an Application Page to the project but compiling failed and gave me the following error:

The type or namespace name 'LayoutsPageBase' does not exist in the namespace 'Microsoft.SharePoint.WebControls' (are you missing an assembly reference?)

The reason for this was quite simple when I created the SharePoint Project I had chosen to deploy it as a Sandbox Solution and application pages are not supported in sandboxed solutions. Selecting the project properties and changing the Sandboxed Solution property to False and it compiled successfully.
 


Dienstag, 7. August 2012

Delete Column from a SharePoint List



If you want to delete a column from a SharePoint List. Following steps on powershel can help you well.

PS> $web = Get-SPWeb -identity http://your/site/name
PS> $list = $web.Lists["Your List Name"]
PS> $column = $list.Fields["Your Column Name"]
PS> $column.Hidden = $false
PS> $column.ReadOnlyField = $false
PS > $column.Update()
PS > $list.Fields.Delete($column)

Donnerstag, 2. August 2012

Install-SPSolution Error

Install-SPSolution: Admin SVC must be running in order to create deployment timer job


When I was trying to deploy the SharePoint 2010 WSP on another server using PowerShell, I got this error when I tried to run the Install -SPSolution command saying that:
Install-SPSolution: Admin SVC must be running in order to create deployment timer job


So all you need to do is to go to the Services section in Administrative Tools and look for the service called SharePoint 2010 Administration, it was on manual start up, changed it to automatic and started it and gotten rid of this error.

Mittwoch, 1. August 2012

Windows Server 2008 R2 – Event ID 8193

VSS Error in Windows Server 2008 R2 – Event ID 8193



After installing SharePoint 2010 enterprise and  setting the managed account to the specific services i become the following error on role fileservices


————————————————————————————————————————————————————–
Event Type:    Error
Event Source:    VSS
Event Category:    None
Event ID:    8193
Date:        12/5/2009
Time:        2:18:03 PM
User:        N/A
Computer:    ServerName
Description:
Volume Shadow Copy Service error: Unexpected error calling routine RegOpenKeyExW(-2147483646,SYSTEM\CurrentControlSet\Services\VSS\Diag,…).  hr = 0×80070005, Access is denied.
.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 2d 20 43 6f 64 65 3a 20   – Code:
0008: 52 45 47 52 45 47 53 43   REGREGSC
0010: 30 30 30 30 30 31 35 36   00000156
0018: 2d 20 43 61 6c 6c 3a 20   – Call:
0020: 52 45 47 52 45 47 53 43   REGREGSC
0028: 30 30 30 30 30 31 32 39   00000129
0030: 2d 20 50 49 44 3a 20 20   – PID:
0038: 30 30 30 30 36 38 36 30   00006860
0040: 2d 20 54 49 44 3a 20 20   – TID:
0048: 30 30 30 30 39 30 39 36   00009096
0050: 2d 20 43 4d 44 3a 20 20   – CMD:
0058: 22 43 3a 5c 50 72 6f 67   “C:\Prog
0060: 72 61 6d 20 46 69 6c 65   ram File
0068: 73 5c 43 6f 6d 6d 6f 6e   s\Common
0070: 20 46 69 6c 65 73 5c 4d    Files\M
0078: 69 63 72 6f 73 6f 66 74   icrosoft
0080: 20 53 68 61 72 65 64 5c    Shared\
0088: 57 65 62 20 53 65 72 76   Web Serv
0090: 65 72 20 45 78 74 65 6e   er Exten
0098: 73 69 6f 6e 73 5c 31 32   sions\12
00a0: 5c 42 49 4e 5c 6d 73 73   \BIN\mss
00a8: 65 61 72 63 68 2e 65 78   earch.ex
00b0: 65 22 20 20 20 20 20 20   e
00b8: 2d 20 55 73 65 72 3a 20   – User:
00c0: 4e 61 6d 65 3a 20 4e 49   Name: ServiceAccountName
00c8: 48 5c 4e 49 4e 44 53 53
00d0: 50 50 52 57 53 45 41 2c   ,
00d8: 20 53 49 44 3a 53 2d 31    SID:S-1
00e0: 2d 35 2d 32 31 2d 31 32   -5-21-12
00e8: 36 30 34 32 38 36 2d 36   604286-6
00f0: 35 36 36 39 32 37 33 36   56692736
00f8: 2d 31 38 34 38 39 30 33   -1848903
0100: 35 34 34 2d 34 30 36 35   544-4065
0108: 35 31 20 20 20 20 20 20   51
———————————————————————————————————————————-
After searching throw internet i found the reason of error on this blog.The reason was a permission peroblem of my serviceAccount. The account was trying to access the VSS registry key and it was failing due to lack permissions.


So here is the fix, just type in regedit.exe in run and navigate the VSS registry key


HKLM\SYSTEM\CurrentControlSet\Services\VSS\Diag


Right click on Diag, go to permissions and give the service account listed under details tab in the error with full control permissions.
This should fix the error, you can check this by restarting the office search service by using
net stop oSearch
net start oSearch


or


stsadm -o osearch -action stop
stsadm -o osearch -action start




If you still run into the same issue, then try the following:
psconfig -cmd services -install
This will configure SharePoint search again.

Montag, 16. April 2012

Get-SPScripts : PowerShell Scripts for SharePoint: Change the content type set on files in SharePoint...

If you have to make changes to a site content type architecture, the requirement may exist to change a batch of files in a document library from one content type to another. This is usually because you either need to reclassify existing documents to a new content type or move documents to another content type so that unwanted content types can be removed from the list.
Read more in this Blog .

Donnerstag, 29. März 2012

Changing Setting for New-Icon in SharePoint 2010


The amount of time the “New” icon is shown in SharePoint 2010 can be changed at the Web Application level using PowerShell.
Below are examples to get or change settings for the icon:

Get  the current Duration of  New-Icon

$webApp = Get-SPWebApplication "http://webAppURL/"
$webApp.DaysToShowNewIndicator

Change the duration of Displaying New-Icon

# Set to 1 Day
$webApp = Get-SPWebApplication "http://webAppURL/"
$webApp.DaysToShowNewIndicator = 1
$webApp.Update()



Prevent the New-Icon from Display

# Essentially, just set the display duration to 0 days.
$webApp = Get-SPWebApplication "http://webAppURL/"
$webApp.DaysToShowNewIndicator = 0
$webApp.Update()

Donnerstag, 8. März 2012

Convert Vhd to Vmdk

You can use WinImage to convert any *.vhd file to * .vmdk

You can downlowd WinImage from here.

After you installed WinImage. Go to following Steps to convert you File to vmdk.

  1. Open winImage and go to Disk:
To conversion VHD to VMDK disk

2. Select the *.vhd file and choose the file that you want to convert.
3. Select the option for Fixed Size or Dynamically Expanding size of your target disk.
4. Choose "*.VMDK" under the file type field. and give the path and name of destination file and click "Save"




Sonntag, 29. Januar 2012

Löschen einer Liste mit Powershell


Beim Etwickeln am Sharepoint brauche ich offter die Sharepointsinhalte schnell zu entfernen. Hier ist die Zwei Zeilen, wie man eine Liste aus der Sharepoint über Powershell entfernen kann:


$w = Get-SPWeb "http://sps2010"
$w.Lists.Delete([System.Guid]$w.Lists["My Custom List"].ID)

Mittwoch, 25. Januar 2012

Problem Steps Recorder

Neues Supporttool in Windows 7: PSR.EXE


Seit Windows 7 und Windows Server 2008 R2 ist ein Aufzeichnungstool PSR (Problem Steps Recorder) im Windows enthatren, mit dem man z.B. eine schöne Aufzeichnung bei der Installation einer Software vornehmen kann.

Dieses Tool zeichnet Schritt für Schritt jeden Klick des Benutzers auf. Damit kann man z.B. vor einer Installation eine Aufzeichnung starten, dann installieren und das Ding erstellt automatisch eine mht-Datei, die man sich anschließend im IE anschauen kann. Das Ding erstellt aber sinnvoller Weise kein Video, sondern eine Step für Step-Anleitung mit Screenshots und Markierungen wo geklickt wurde. Da man die mht auch in Word aufmachen kann, kann man den Output anschließend nochmal überarbeiten und auch als Word abspeichern.
Eine genaue Beschreibung finden Sie in der Knowledgebase des Forums Office 2010 Hilfe.

The content type is part of an application feature

Recently I had the problem in a production environment that after the deactivation of a feature I was not able to delete the content ty...