Feeds:
Posts
Comments

Archive for the ‘Workflows’ Category

When creating event receivers or workflows it might be interesting to look at the differences between the following SPListItem methods. The differences might be subtle but it can make a huge difference when you have extra event receivers or workflows attached to your SharePoint list or items.

Update()

  • Updates the item in the database.
  • Updates the “Modified” and “Modified by” values.
  • Creates a new version

Systemupdate()

  • Updates the item in the database.
  • No changes in the “Modified” and “Modified By” fields.
  • No new version.
  • Triggers the item events.

Systemupdate(true)

  • Same as Systemupdate() and increments the item version.
  • Using SystemUpdate(false) is exactly the same as SystemUpdate()

UpdateOverwriteVersion()

  • Updates the item but does not create a new version.
  • Updates the “Modified” and “Modified by” values.

Note that :
You can also disable the triggering of events by using “this.EventFiringEnabled = false;”. Do your update and enable the events again with “this.EventFiringEnabled = true;”

Hope it helps,
W0ut

Read Full Post »

Lost again a few hours today.

Apparently workflows on your SharePoint  site need the hidden ‘OffWFCommon’ feature to be enabled. If not the workflow code is simply not executed.

The annoying thing is that there is no indication that the workflow is not starting. You can assign the workfow to a list ,  let the workflow start on an item, no error or exception. So they seem to execute but actually nothing is started.  I noticed this because the workflow ‘status’ field remained empty. Normall it contains: ‘In progress’, ‘Completed’,  ‘Exception occurred’,  … Even the SharePoint logs remained silent.

After hooking up my Visual Studio debugger to the SharePoint site ( which was based upon a custom Site Definition),  it became clear that the code of the workflow was never executed. On an other site collection the custom workflow did work. So it had to be something with the settings of my new site collection.

This post pointed my in the right direction. It turned out that to enable workflows to run, you need to activate the ‘OffWFCommon’ feature. Adding the feature to my Feature list in the Site Definition solved the problem.

After adding the feature in my Site Definition the workflows started correctly.

<!–OffWFCommon –>
<Feature ID=”C9C9515D-E4E2-4001-9050-74F980F93160″ />

Read Full Post »

Follow

Get every new post delivered to your Inbox.