August 27, 2009

MOSS 2007 Maximum Limitations

Filed under: Development — Tags: , , , , , — Tim Lefler @ 8:31 am

Assembled from a post here on SharePoint 2007 maximum limitations:

Entity Max Value
Site Name 128 Characters
Site URL 255 Characters
Display Name 128 Characters
Connection String 384 Characters
Email Address 128 Characters
Version Numbers 64 Characters
Virtual Server Friendly Name 64 Characters
SQL Database Name 123 Characters
SQL Database Column 128 Characters
SendEmail Activity Email Body 2048 Characters
SQL Database Table Name 128 Characters
SQL Role Name 128 Characters
Server Name 128 Characters
Windows User Name 300 Characters
Windows Password 300 Characters
Dependencies per Object 32 Objects
Zone Enumeration Value 4 Zones
Default SQL Timeout 300 Seconds
Number of Simultaneous Workflows that can be run* 15

(more…)

August 26, 2009

Retrieving SharePoint Field Data

SharePoint uses lot of comlicated underlying schemas, delimiters and formats when storing field data into the database.  Unfortunately, you need to access different fields in diferent ways!  Below are the techniques I’ve used to access field information using best pratices….  kudos to this post for most of the technical beginning:

http://sharepointcodeblock.blogspot.com/2008/07/properly-populating-and-retrieving.html

I’ve added what I’ve learned since to try to make this as complete as possible.

(more…)

How to Check the for “Completed” Status of a Sharepoint Workflow Task

Filed under: Information Technology — Tags: , , , , , , — Tim Lefler @ 3:08 pm
OnTaskChanged Workflow

OnTaskChanged Workflow

My latest adventure in workflow development had to do with checking the status of a task my workflow had initiated.  Using a State Machine workflow I  create a task and want to transition to another state after the task’s status is set to completed.  See my workflow to the left to get the genral idea.  I wanted to use a CodeCondition check in the IfElseActivity Branch to determine if I should transition to the next state.  I couldn’t seem to find a simple way to check the “Status” property.

Turns out you can’t reference the “Status” property easily because it is an “ExtendedProperty” of the task.  I came up with this method to check the status of a SharePoint task using the following code snippet to return a “True” if the status is set to “Completed”

white_spacer

(more…)

August 25, 2009

How to programatically delete all tasks associated with a SharePoint Workflow

Filed under: Development — Tags: , , , , , , — Tim Lefler @ 10:02 am

Here is a VB.Net code snippet to delete all of the tasks associated with a SharePoint Workflow.  I needed to be able delete all of the tasks associated with the workflow when my state machine workflow changed to a different state.  This technique worked for me, simply make the procedure below a “ExecuteCode” method for a Code Activity:

Private Sub RemoveEscalationTask(ByVal sender As System.Object, ByVal e As System.EventArgs)
 
     Dim taskcollection As SPWorkflowTaskCollection = workflowProperties.Workflow.Tasks
     Dim taskindex As Integer = taskcollection.Count
     Dim thetask As SPWorkflowTask
 
     Try
         ' Cycle through all of the escalation tasks and delete them
         While taskindex > 0
              thetask = taskcollection(taskindex - 1)
              thetask.Delete()
              taskindex = taskindex - 1
        End While
     Catch ex As Exception
 
     End Try
 End Sub

August 24, 2009

How to Set Breakpoints and Debug SharePoint “Delay Activity” workflow using Visual Studio 2008

Filed under: Development — Tags: , , , , , , , , , , — Tim Lefler @ 4:59 pm

Recently, I was debugging one of my SharePoint workflows using Visual Studio 2008 and could not figure out why breakpoints I had set within my code were not firing.  In a previous post, I talked about reasons why your delay activity might not be firing at all but what if your activity fires but your breakpoints do not?

By default when inter-actively debugging a workflow, Visual Studio attaches to the  IIS worker process, w3wp.exe.  If you use any “Delay” activities within your workflow, this gets triggered and ran by the Windows SharePoint Services Timer process, owstimer.exe.  Because the owstimer.exe process is loading and executing a separate copy of the assembly from the Global Assembly Cache (GAC) visual studio is not monitoring the correct instance of the assembly for breakpoints.

This complicates the debug process a little.  You cannot simply step through the code execution from beginning to end.  Instead, as the developer, you need to have a good understanding of what to attach to when debugging events triggered by the owstimer process or w3wp process.  Follow the procedure below to attach visual studio to the owstimer process and allow breakpoints to be handled by the correct copy of the assembly. (more…)

August 17, 2009

How to Hide SharePoint Columns using the default ListFormWebPart in NewForm.aspx

I have some fields in my list that I do not want the end user’s to see when presented with my List’s the NewForm.aspx page. I played around with a whole bunch of different techniques to do this.  Seems like this should be something easy enough to do with SharePoint Designer doesn’t it?  Hide the default ListFormWebPart then add a new custom list form and delete the columns you do not want to display. Although this works there were all kinds of problems dealing with Attachments.  When creating a new item, I would get a nasty error:

Failed to get value of the “Attachments” column from the “Attachments” field type control.  See details in log. Exception message: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)..

…. see this post for all kinds of problems with attachment functionality and custom forms.

I stumbled upon Scott Wheeler’s awesome post here: (more…)

August 14, 2009

SharePoint Workflow Delay Activity not Firing for a VS2008 State Machine Workflow

Filed under: Development,Information Technology — Tags: , , , , , , , , , , — Tim Lefler @ 3:18 pm

Really struggled with this one for a few days.  Had a Visual Studio 2008 workflow I was developing and was just trying to get a Delay Activity to fire during a state machine event activity.  Just could not seem to get the Delay activity to wake up. Below is the high-level view of my state machine workflow:

State Machine Workflow Diagram

State Machine Workflow Diagram

(more…)

August 13, 2009

How to Add a “Return to Sender” to a SharePoint Designer Custom New Form

Filed under: SharePoint Designer — Tags: , , , , , , , , — Tim Lefler @ 9:04 pm

After you have created a Custom New Form for your customized list or library using SharePoint designer, you’ll notice that the default action when clicking on the “Cancel” or the “Save”  button is to add the item to the list but not to navigate away from the form.  Most people would prefer to have the Form return to the previous screen when at least the “Cancel” button is pressed.    I’m going to step through how to perform this customization using SharePoint Designer.  I’m assuming you already have a custom New Form produced that will input new items into your custom list or library.  If not check out my previous post here.

When SharePoint navigates to a default form for a list or library, the URL of the originating page is passed as a query string called “Source”.  Use the procedure below to make use of this query string variable to provide navigation after the form has been submitted.

(more…)

How to add a customized SharePoint Designer “NewForm.aspx” page to your list

Filed under: SharePoint Designer — Tags: , , , , , , , — Tim Lefler @ 9:02 pm

I wanted to document how to use SharePoint Designer to create a customized “NewForm.aspx” so that you can modify what list column fields are available for a new item.  I recently wanted to collect information for a new list item but didn’t want the user to be able to fill out all the fields on the out of the box new list item form.  This is a technique that can be used to only display certain fields or to customize the look and feel of the page.

1.  To start with open the existing default “NewForm.aspx” page and save a copy with a different name (ie. NewFormModified.aspx”.

Note: Do not modify the existing page.  There are a lot of troubles associated with getting rid of this first form.  Just create another.

2.  Select the default “ListFormWebPart”  on your renamed “NewForm.aspx” web page.

Webpart Properties for DefaultWebpart

Webpart Properties for DefaultWebpart

3,  Right click on the “ListFormWebPart” and hide the web part by checking the “Hidden” check box in the “Layout” section.

Note: Do not delete the existing webpart!! Once again there are a lot of troubles associated with getting rid of this existing default webpart.  Just hide it and create another.
(more…)

How to set IIS website for NTLM only authentication

Filed under: Information Technology — Tim Lefler @ 11:15 am

By default when you select “Integrated Windows Authentication” for your IIS 6.0 website it is setup for “Negotiate (Kerberos), NTLM”.

integrated_authentication

Integrated Windows Authentication Image

Sometimes, you do not want Kerberos to be attempted (more…)

Older Posts »

Powered by WordPress