Is it possible to know beforehand whether event receivers on a list will always execute before any workflows associated with that list?
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
If a list has workflows defined which are set to auto-start, these will always execute before any other 'ItemUpdated' or 'ItemCreated' event receivers by default. It is possible to re-order these in code however - I needed to do this once as for some reason I needed a receiver to fire before the workflow did it's processing. To re-order, simply get the SPList.EventReceivers and modify the Sequence property of each one you want to change (and call .Update()). Remember though, that if someone disables workflow and then configures it again (with auto-start), SharePoint will add the SPWorkflowAutostartEventReceiver back in as Sequence=1, meaning the re-ordering would need to happen again. |
|||||
|