none
SPWorkflowTaskProperties.ExtendedProperties

    Question

  • Hi

    I am modifying an existing SharePoint 2007 workflow.  The workflow has an approval form created in InfoPath 2007.  The form has various comment fields.  I have added a dropdown box.  The user must select a value from the dropdown box when they fill out the approval form.

    In the code behind the workflow, I would expect the ExtendedProperties collection of the SPWorkflowTaskProperties to include an item containing the value from the dropdown box, but it does not.

    As part of the modification of the InfoPath form, I edited the ItemMetadata.xml file that is used as a secondary data source, to include an extra attribute ows_mydropdown="".

    In the form, the dropdown appears correctly bound to an element in the main data source.

    I must have missed out an essential step here... any ideas? 
    Monday, February 07, 2011 12:20 PM

Answers

  • InfoPath form field value has to be promoted to SharePoint List first.

    Were you able to promote it? if so, then this promoted value can be used in workflow by using onTaskChanged_Invoked(object sender, ExternalDataEventArgs e) as Dennis mentioned.

     

    Please refer code snippet below.

     

    public Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties workflowProperties = new Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties();

     

            private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)

           {

                if (workflowProperties.Item["Full Name"] != null)

                    UserName = workflowProperties.Item["Full Name"].ToString();


    백상하 - http://blog.naver.com/lightyea/
    • Marked as answer by Leoyi Sun Thursday, February 17, 2011 1:57 AM
    Tuesday, February 15, 2011 12:31 AM

All replies

  • Are you retrieving the value after the InfoPath form is submitted back? 

    I generally assign the values I need within the task to a workflow variable so that I know for sure it is persisted after the task is completed.  Can you set a breakpoint in your code to see if the value is being returned from the InfoPath form?  I am currently using onTaskChanged_Invoked(object sender, ExternalDataEventArgs e) for this.

    Dennis

    Monday, February 14, 2011 8:19 PM
  • InfoPath form field value has to be promoted to SharePoint List first.

    Were you able to promote it? if so, then this promoted value can be used in workflow by using onTaskChanged_Invoked(object sender, ExternalDataEventArgs e) as Dennis mentioned.

     

    Please refer code snippet below.

     

    public Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties workflowProperties = new Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties();

     

            private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)

           {

                if (workflowProperties.Item["Full Name"] != null)

                    UserName = workflowProperties.Item["Full Name"].ToString();


    백상하 - http://blog.naver.com/lightyea/
    • Marked as answer by Leoyi Sun Thursday, February 17, 2011 1:57 AM
    Tuesday, February 15, 2011 12:31 AM