We have a requirement by our Finance department, for auditing purposes, to copy the workflow history from the Workflow history on a comments field on the form, once the form has been approved and finalised. I'm just wondering how you do this. So the information we'd need to show is the name of the task, who completed it and the date/time that it was completed.
Any assistance or pointers is appreciated
If you use workflow to do this you can copy the contents of the common property "All Approver Comments" to be in a multiple lines of text column in your list and just display that on your form?
I do this on almost any workflow I create.
I have a single line of text field for workflow status and a multiple line of text field for workflow comments in the form. Then in the workflow I use "Set field value" to copy the text into the fields.
I set this and the workflow status after every action in the workflow so it always displays the current status and comments of the workflow.
I think the easiest way of doing this would be to record this data as part of the workflow and save it into columns in your list. You can then display this on the form but you probably want to disable the fields so that no-one can overwrite this data.
So as soon as a task is approved save the date/time, approver and the task name should be easy because you are specifying it any way when creating the task.
Let me know if I need to explain this in more detail.
I do this for every approver. I put the last approval comments in separate multiline text boxes for each approver then use a regex to strip out the email chain if using lazy approval to get rid of the "noise"
I collect the task history throughout the workflow process. I have even developed a UDA for it. I try and keep an XML string with the task history in it and convert it to HTML to present it back to the user.
If you need to collect the data at the conclusion of each workflow I would create a task collection variable and at the end of the workflow loop through the collection of task IDs to build your history.
We often have approval steps using approval tasks which update the main list item/form - and want to show when approvals were carried out and when the next approver should have received a notification.
Each approval decision/date/comments/etc are used to update the main list item/form.
Included in each approval section is a Close-Status field - which is updated at the end of every approval task flow - "Approved by LastName, FirstName - Date/Time" The user name comes from Current User (Display Name) on the approval form (hidden); the date is generated by the workflow, selecting the date/time the workflow ran.
...this gives everyone an overview of who did what and when. Having this also lets us know if someone other than the assigned user filled out he approval form. If your form is printed off or saved as a PDF, the approval history is also there.