Dienstag, 22. Januar 2013

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 types that I have generated within my feature from Site Collection.


Solution
But the solution is very easy. Following steps will help you to solve this problem:


  1. You must find out all of usages of specific content type. I will suggest use SharePoint Manager 2010 and for every content type you will notice property called “Usages” it basically tells you where the content type is used. 
  2. Then you can delete all of its reference.
  3. Empty Site Collection  Recycle bin
  4. Deactivate the feature
  5. Your Content Type is now removed.

I hope i could help someone else with this post. Enjoy it :-)

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)

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...