Monday, April 19, 2010

Remove / Hide the "Approval" and "Collect Feedback" workflow in the "Start a New Workflow" page.

Solution : Go to : Shared Service Administrator > Site Setting > Site Content Type Gallery > Site Content Type,

Select 'Document' or that content type where you want to remove 'Approval' or 'Collect Feedback' OOB Workflows.

Click 'WorkFlow Settings' > remove the 'Approval' and 'Collect Feedback'

It is recommended to create your own site content type to do this otherwise all those document libraries will be affected which have that content type.

Friday, February 5, 2010

Deploying a User Control in MOSS 2007 with Feature

To deploy our user control, Follow below given steps,
 Copy the user controls ascx and cs into directory
~\12\template\controltemplates
Need to create two file Feature.xml and Control.xml


Feature.xml
—————–
#?xml version="1.0″ encoding="utf-8″ ?#
#Feature Id="Generate New GUID"
Title="UserControlTest"
Scope="Farm"
Description="UserControlTest"
Version="1.0.0.0"
xmlns="http://schemas.microsoft.com/sharepoint/"
Hidden="FALSE"#
#ElementManifests#
#ElementManifest Location="control.xml" /#
#/ElementManifests#
#/Feature#

You can define you feature scope in xml attribute 'Scope'.Here we are using farm level for this feature.

control.xml
—————–
#?xml version="1.0″ encoding="utf-8″ ?#
#Elements xmlns=”http://schemas.microsoft.com/sharepoint/"#
#Control Id="UserControlTest"
Controlsrc="~/_controltemplates/ UserControlTest.ascx" Sequence="90″#
#/Control#
#/Elements#

Create a folder to keep these xml files
~\12\TEMPLATE\FEATURES\#Folder Name#

Copy the both files feature and control in the above location
~\12\TEMPLATE\FEATURES\#Folder Name#\Feature.xml
~\12\TEMPLATE\FEATURES\#Folder Name#\control.xml

Now use stsadm to register feature
stsadm -o installfeature -filename CustomQuickLaunch\Feature.xml

Now Open the aspx page on which you want to deploy the control in SharePoint designer add this where you want to deploy the control

#SharePoint:DelegateControl ControlId="UserControlTest" runat="server"##/SharePoint:DelegateControl#

Custom Workflow in SharePoint (Sharepoint Designer Vs Visual Studio)



Using SharePoint Designer


Using Visual Studio




Can write only sequential workflows.


Can write both sequential and state machine workflows.


Automatic deployment against the specific list or library against which workflow is being designed.


Can be deployed as a feature.


Logic is defined declaratively using Steps which comprises of Conditions and Actions


Logic could be defined through custom code written using C# or VB.NET.


Workflows could be associated to a specific list or library.


Workflow can be authored as Template which once deployed could be associated with any list or library.


Workflow modifications not possible.


Workflow modifications are possible using Modification forms built using ASP.NET or InfoPath form.


Workflow markup, rules all are stored as a document library on the site.


Workflows are compiled as an .NET assembly.


Can’t be debugged.


Debugging is possible using Visual Studio.

Wednesday, December 30, 2009

View a detailed error in sharepoint

To View a detailed error in sharepoint, you need to follow below steps in your site’s web.config file .


Step 1: Change 'CallStack' value from false to true in SafeMode attribute as shown below.
[SafeMode MaxControls="200" CallStack="false" .../]
To
[SafeMode MaxControls="200" CallStack="true" .../]


Step2: Change 'customErrors' tag mode from ‘On’ to ‘Off’.
[customErrors mode="On" /]
To
[customErrors mode="Off" /]


Step3: Change 'Debug' from 'false' to 'true' in 'Compilation' attribute.
[compilation batch="false" debug="false"]
To
[compilation batch="false" debug="true"]


Step 4: Restart the IIS.

Tuesday, September 29, 2009

An error has occurred after workflow completed MOSS 2007

If you have a "built in" or custom approval workflow setup for your document library. The workflow runs correctly, however sometimes you look at the workflow status, you may receive an error after the task has been approved and completed such as,
Event Type: Error User ID: System Account Description: An error has occurred in [your workflow name].
Resolution: There is a section "Post-completion Workflow Activities", where you can check "Update the approval status (use this workflow to control content approval)". If you check this option, and you do NOT have content approval enabled on the library level, you get the system account error message. If you do not check it, everything works fine.

Thursday, September 3, 2009

Most common problems in SharePoint naming: spaces

When I did create a workflow action, Using SharePoint Designer 2007, which emails the URL of the current item in a list. I did use below lookup items in my workflow mail
1-[%LISTNAME: Encoded Absolute URL %]
2-[%LISTNAME: Server Relative URL%]
3-[%LISTNAME: URL Path %]
4-[%LISTNAME: Path %]

There is one problem which will always occur and another which may occur, depending upon the naming convention you use for your lists.

Problem 1: ID number pulled from URL actions are appended with "_.000" in case 1, 2 and 3.
Problem 2: In case 4, Spaces within list names are sometimes ignored, sometimes not. i.e. "My Test List" could be translated into "My Test %20List" - causing a 404 error during the URL lookup.

Solution: Here I am solving problem 2. It works for me. According this,

You need to rename your lists to contain no spaces. Now this would seem easy to do - enter your list settings, go to Title, description and navigation, and change the name. This will not work as it seems to only change a pointer for SharePoint references, but not anything that has to do with URL paths.

You need to rename the list itself within SharePoint Designer to have one single list name. Right-click on the selected list, select "rename" and rename the list to something without spaces. SharePoint Designer will save this information to your SharePoint site and references in all attached workflows will reflect these changes.

Basically this changes internal name of list. Now you can rename list name again from SharePoint list setting, go to Title, description and navigation, and change the name, if you need to display list title with space to all.

Wednesday, September 2, 2009

Error "401 Unauthorized" For MOSS FBA

When you have SharePoint Server 2007 implementation with Form Based Authentication (FBA) and anonymous access turned on you may experience 401 Unauthorized when you visit the site like http://xxxxxx/sites123/pages123/default.aspx

Look into your web.config file for Web Application that you extended to use FBA for *compilation* tag and edit it to make it look like below. Save the web.config and give it a run.

*compilation batch="false" debug="false" /*

Note: Please replace * (Blogger not support HTML tagging)

And also when you visit the URL could you please check which Zone does the site belong to in the IE status bar?
I suppose the URL belongs to the Local Intranet Zone or Trusted Sites which automatically log on with your current Windows credential. If your windows credential does not have the permission to access the site, you would get 401 Unauthorized error. If so, please remove the sites from the Local Intranet Zone or Trusted Sites and try again.

Hope it will help !! :-)