views:

484

answers:

2

Hi chaps... I have in sharepoint a workflow process that runs when a task is added to project tasks, i also then add an entry to the 'calendar', when the item details change, name or dates in either calendar or tasks both update fine.

What i would also like to do is when i delete an item from 'project tasks' that the related entry in the 'calendar' is also deleted... does any one know how this is achieved please.

many thanks!

geoff

A: 

I understand you created the workflow with a SharePoint Designer workflow but as you can see in the workflow settings you don't have any way to detect when an item was deleted, this requires a little hacking but it is possible, first the probably cleaner but harder to accomplish C# solution:

You will need an EventHandler connected to your Project Tasks list which has on the project item the ID of the calendar item stored, and inside the ItemDeleted event do your extra deletion.

Now, the SharePoint Designer one. As mentioned before you cannot detect the item being deleted, but you can have a manual workflow created to delete items. Create a new SPDesigner workflow name "Remove Project" in which it deletes the Calendar item based on the Id you will store in a field in your Project Tasks item. Tada

You might want to find ways of hiding the Delete button from the items (or go as far as changing its behavior to start your workflow) and for that I would recommend some jquery functionality, endusersharepoint.com had a great example but the site appears to have changed into a blog, not sure.

F.Aquino
A: 

Is there any other solution for this?

I can't deploy custom code on my farm and i have too many lists that i can't apply the other way on them.

Thanks.

frbry