By Serge Luca
Step 8/20. Bringing data from the workflow to the task form
The manager needs all the necessary information to approve or reject the expense report; therefore we need to display the expense report data into the task form.
Start from step 7 solution.
Open the Infopath task form ( ApproveReject.xsn) in design mode .
Update the form like this:
Rename the controls in order to have the following Data source:
The content of these extended properties will be sent to the Infopath Task form.
Create the following .xml file and name it ItemMetadata.xml (Spelling and capitalization must be exactly the same here: both for the file name and for the extended properties name, each must be prefixed with ows_):
Click on the ApproveRejectTask activity and add 3 new extended properties to the ApproveRejectTaskproperties:
Add a new Data Connection to link the infopath form to this xml file:
Click on Next:
Click on Next and select the .xml file:
Click on Next and select the first option :
Keep the default options and click on Finish.
Now we are going to bind the form field to the new Data Connection fields:
In the task form, click on the submitter field :
In the data panel, click on the formula (fx) button:
Click on the insert field or group button and switch the Data source to ItemMetadata (secondary):
Select ows_submitter :
Repeat this for the amount and the description fields.
Save and publish the form; make sur the published template is in your project folder.
Rebuild the solution, call install.bat and test the workflow by following the next scenario:
Add a new user account : Jon; Jon will be Bill’s manager.
Log in as Serge (Serge’s manager is Bill, not Jon) and submit the following expense report:
Start the workflow: normally Serge’s manager is Bill; if Bill is on vacation,serge will submit the expense report to Jon:
A task will be assigned to Jon:
If Jon clicks on the task hyperlink:
This hands-on training is the property of Redwood S.L sprl and may not be organized in class or in group without the prior written permission of Serge Luca. Should you wish to organize this hands-on training in your company or institution, please contact Serge Luca first to enter into a licence agreement. Each trainer or teacher using this hands-on training should have a licence agreement. Please ask your trainer or Serge Luca whether he or she has entered into a licence agreement with Redwood S.L sprl.
The hyperlink to this hands-on training may be placed on your website for free, on the condition that the name Serge Luca is clearly mentioned in the reference. Please send us a mail containing the link to the web page our reference is used on.