1

I have a form created in InfoPath, that I would like to automatically start the workflow when the file is checked in. I have Sharepoint Designer, but I don't see the field for 'Checked in'.

There is a field under 'Field from source' that says 'Checked out to'. And do I start the workflow when the file is created? Can the workflow be triggered if a file is submitted?

Thanks!

2 Answers 2

1

This would be my approach...

1) First create an event receiver as given in below code. This code will make "Check In Comments" field mandatory. Check In Comment is the multi-line textbox that appear when you are trying to check-in a file in a library.

public class EventReceiver1 : SPItemEventReceiver 
{
  public override void ItemCheckingIn(SPItemEventProperties properties)  
  {
    base.ItemCheckingIn(properties);
    string comment =
    (string)properties.AfterProperties["vti_sourcecontrolcheckincomment"];

    if (string.IsNullOrEmpty(comment))
    {
       properties.ErrorMessage = "Comment Empty";
       properties.Cancel = true;
    }
}
}

2) Download custom SPD Workflow Activity - Start Another Workflow and install it on SharePoint Server .

3) Create a workflow where you should a put a condition - Wait for Check In Comment to be not empty and just right after this condition insert the custom action Start Another Workflow.

In all you must create two workflows. One is your actual workflow and the other is the triggering workflow that contains step 3.

Hope this helps.

0

Check In Item

This action is initially displayed in a workflow step as Check in item in this list with comment: comment. Checks in an item that is checked out.

Following is an example of what the action might look like in a workflow step,

Check in item in Expense Reports with comment: Expense report approved

Note You can only check in items from a document library.

using IF Condition trigger workflow Checkin Item.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.