A new workflow custom function called P2K_CF_GET_DAPR_COMMENT was created for use in the workflow products such as WF_AAL, WF_SPA, etc. to look for any approval records that are tied to the subject record being changed and return the comment column.
\\ \\
Currently of the 23 approval areas only 12 have workflow products available.  See chart below.\\
Approval Areas and Workflow Product Cross Reference
||Value||Displayed||WF Product||WF Product Description
|01|Disabled| |
|02|Pay Trans Batches|WF_PBT|Workflow – Batches
|03|Pay Header Batches|WF_PBT|Workflow – Batches
|04|Performance Reviews|WF_SRV|Workflow – Reviews
|05|Personnel Actions|WF_SPA|Workflow – Personnel Actions
|07|Job Requisitions|WF_RPO|Workflow – Postings
|08|Applicant Hires|WF_RAP|Workflow – Applications
|09|Development Programs|  |
|10|Development Activity|  |
|11|Courses|  |
|12|Class Schedules|  |
|13|Training Resources|  |
|14|Benefit Elections|WF_BEL|Workflow – BE Elections
|15|Assessments|  |
|16|Class Registration|WF_CRSE|Workflow – Class Registrations
|17|Time Sheets|WF_PTS|Workflow – Time Sheets
|19|Leave Lines|WF_AAL|Workflow – Leave Lines
|20|Clock Entries ((Authorize)|WF_TCE|Workflow – Clock Entries
|21|Education| |
|22|References|  |
|23|Work History|  |
|24|Open Enrollment EEs|WF_BOEE|Workflow – Open Enrollment EE
|25|Positions|  |
|26|Time Sheet Entries (Authorize)|  |

\\ \\
There could be multiple approval records out there for a subject record at any point in time, so records with the following approval statuses will be bypassed: 
* 01 – Approval Cancelled
* 20 – Future Approval
* 80 – Approval Historic
* 95 – Declined Historic

From there we will sort the records by the change date descending to ensure that the most recent change will be the one that triggered this.

!!Implementation
1.  To use this custom function an entry needs to be made to the X_UC_FUNCTIONS lexicon as below
[{Image src='IMLN_UC_FUNCTIONS.jpg' width='700' align='center'link='attach/IMLN_UC_FUNCTIONS.jpg'}]
\\
2.  When using this custom function the value needs to be returned to a character variable like:
[{Image src='IMUC_PA_REJ_MAIL_VAR.jpg' width='700' align='center' link='attach/IMUC_PA_REJ_MAIL_VAR.jpg'}]
\\
3.  A sample Workflow Action may look like this:
[{Image src='IMWA_PA_REJECTED_MAIL.jpg' width='700' align='center' link='attach/IMWA_PA_REJECTED_MAIL.jpg'}]
\\
4.  A sample Workflow Usercalc may look like this:
[{Image src='IMUC_PA_REJECTED_MAIL.jpg' width='700' align='center' link='attach/IMUC_PA_REJECTED_MAIL.jpg'}]

In the example above, there is a check to see if the PA status has changed before anything is done.\\  \\
Then in this example, we are only dealing with Declined/Not Approved PA’s so we want to ensure that the status is for that.\\  \\
The actual custom function is called and the value of the found comment field is returned into the variable dapr_comment created.\\ \\
If the comment is left blank, an email is not sent. In this case, you may want to have one action line (email content) for when a comment is supplied and a different one for when a comment is not supplied.


----

![Notes|Edit:Internal.Approval+Comments+Available+In+Workflows] 	
[{InsertPage page='Internal.Approval+Comments+Available+In+Workflows' default='Click to create a new notes page'}]