I have a scenario where i have vacation request which is a infopath form when submitted workflow kicksoff and the date item should be updated in calender and if it is deleted the item should be deleted from calender .what approach can i follow to do this.
You can do this approach (which is how I do it):
- Assuming your users only have Contriute permission to your form library, remove that permission and replace with 'Form Contribute NO DELETE'. The idea is to stop users from having the ability to delete an item from your form library. Obviously, site collection admins may still have Contribute permission. So they will need to understand how your form works.
- Add a field/column to your form library that indicates when a user wants to delete it (say, call it, 'Delete Form'). Add a button to your form to allow users to click it when they want to delete the form. Then set your new field to Yes/True when they click this. Change your forms/views to mimic the deletion of the form when that field is Yes/True--eg, do not display form in views when the field is Yes/True, or indicate something on the Form to say this form is marked for deletion (this is in case they try to access it before the workflow below completes its task).
- In your workflow, when a form is added, create your calendar entry and grab the ID of that calendar entry and save it back to your form (using a new field, say, 'Calendar Entry').
- Set your workflow so when it sees your new field is Yes/True, it deletes first your calendar entry (referencing the ID you saved earlier) if there is one. Then delete your form. Your workflow must run with an account that has delete permission to the form library (and also to your Calendar).