This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Capture comments from Workflow Activity.

Naveen - Friday, May 31, 2013 9:09 AM:

Hi,

I am trying to capture the comments that the approvers enter while completing a workflow activity, and append them to the comments on the Item.

I have tried doing this on the "Activity" Server event on "on Vote" event, but the comment value is null or blank, possibly because the value is still not updated in the db.

<Code>

Dim MyInn As Innovator = Me.getInnovator()
Dim CtrlItem As Item = MyInn.newItem("Activity", "Get Controlled Item")
CtrlItem.setID(Me.getID())
CtrlItem = CtrlItem.apply()


Dim ActivityAsgn As Item = MyInn.newItem("Activity Assignment", "get")
ActivityAsgn .setAttribute("select", "id,state,current_state,buyer,comments,related_id(keyed_name)")
'ActivityAsgn .setProperty("current_state", "Active")
ActivityAsgn .setProperty("source_id", Me.getID())
ActivityAsgn = ActivityAsgn .apply()



'
For I As Integer = 0 To (ActivityAsgn .getItemCount() - 1)
    Dim CurrActAs As Item =  ActivityAsgn .getItemByIndex(I)
    Dim currIden As String = ActivityAsgn .getItemByIndex(I).getRelatedItem().getProperty("keyed_name")
    Dim strComm As String = CurrActAs.getProperty("comments")
Next I

<!Code>

To complicate things, there are 3 Approvers, A B and C, the comment has to be against each approver

eg. : 

A : Comments from A

B : Comments from B

C: Comments from C

Thank you,

Naveen



Brian - Monday, June 3, 2013 8:02 PM:

Hi Naveen,

If you change the event to onClose then the comments will all be available to you.

You will get all of the comments in one go but they will each belong to an ActivityAssignment so appending the person should be no issue.

This means you won't see the comments as they vote but you will see all of them after the voting has closed.

The other option is to use a signoffs tab on the Item that shows all of the workflow activity and gives you the option of voting direct from the item rather than having to go back to the InBasket.

Hope this helps,

Brian.



Naveen - Thursday, June 13, 2013 5:56 AM:

Hi Brian,

Thanks for the reply,

Guess I will just have to go with updating the comment when all the assignments are closed.

Naveen



plm_stud - Sunday, August 24, 2014 2:32 PM:

Hi Brian,

It's required for me to capture comments at the time of voting, it's mandatory according to requirement.

Please suggest.

Thanks