I'd like to be able to change (add/delete) the approvers associated with the OOB Approval Workflow that I have associated with a InfoPath form library on SharePoint 2007. I want to change the approvers from within my InfoPath form, I do not want to go to change it in the Workflow settings.

Is this possible in SharePoint 2007? If not, do I need to create a custom workflow? If so, what would be the high level steps that I would need to take to get something like this set up with InfoPath 2007/2010 form deployed to a SharePoint 2007 form library?


migrated from stackoverflow.com Oct 29 '11 at 18:12

This question came from our site for professional and enthusiast programmers.


There are two methods you can use AFAIK:

A. Inject the approvers to the Association Data from code behind.

    SPWorkflowAssociation wrkFl = docLib.WorkflowAssociations[0]; 
    site.WorkflowManager.StartWorkflow(itm, wrkFl, wrkFl.AssociationData, true); 

~Create an eventhandler. Make sure you publish the approver field from the InfoPath form to a list column (you can also read the InfoPath XML, but requires more code). ~Grab the approver field value and pass it to the associationData string.

B. Pass the approvers into the Approvers parameter of the Approval Workflow during design time

For more info:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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