Forum Discussion
Former_Member
8 years agoAccelerator III
Jamar,
I did something similar in the past that required me to put comments in an email notification if/when they were included in a workflow approval/delegate. On the workflow, add an onDelegate and "post method" on the transition to grab the comments. It needed to be the "post method" because as you said, the comments needed to hit the server first. This line of code helped grab the comments for the very latest vote on the activity:
Item actAssign = this.newItem("Activity Assignment", "get");
actAssign.setAttribute("select", "comments,path,related_id(keyed_name),source_id");
actAssign.setAttribute("orderBy", "closed_on DESC");
actAssign.setAttribute("maxRecords", "1");
actAssign.setProperty("source_id", wf_id);
actAssign = actAssign.apply();
FYI...wf_id holds the id of the workflow