Purchasing

Get Involved. Join the Conversation.

Topic

    Boyuan Zhu
    How to Add Final Approver Information to Order PDF
    Topic posted July 20, 2018 by Boyuan ZhuBronze Trophy: 5,000+ Points, last edited August 23, 2018, tagged Agreements, How-To, Orders 
    66 Views
    Title:
    How to Add Final Approver Information to Order PDF
    Content:

    You can add an image of the final approver's signature to your order PDF for suppliers or buyers to see who finally approved the order. This post is the first post in a two part series to add the signature to the PDF. In this post, we will cover how to add the approver's information to the PDF data model. 

    1. Start by making a copy of the data model in your Custom folder. This is the data model that the customized report will point to. 
    2. Open the archive dataset and add attributes for the approver display name and username to the SELECT clause:
      Approver.DISPLAY_NAME As Approver,
      Approver.USERNAME As Username
      
    3. Add the following statement to the FROM clause:
      (SELECT DISTINCT
      Name.DISPLAY_NAME, Username.USERNAME, Hist.OBJECT_ID
      FROM
      PO_ACTION_HISTORY Hist, PER_PERSON_NAMES_F Name, PER_ALL_ASSIGNMENTS_F Assign, PER_USERS Username 
      WHERE
      Hist.PERFORMER_ID = NAME.PERSON_ID
      AND Hist.ROLE_CODE = 'APPROVER'
      AND Hist.ACTION_CODE = 'APPROVE'
      AND Name.NAME_TYPE = 'GLOBAL'
      AND Hist.PERFORMER_ID = Username.PERSON_ID
      AND Hist.SEQUENCE_NUM = (SELECT
      MAX(History.SEQUENCE_NUM)
      FROM PO_ACTION_HISTORY History
      WHERE History.ACTION_CODE = 'APPROVE'
      AND History.ROLE_CODE = 'APPROVER'
      AND History.OBJECT_ID = Hist.OBJECT_ID)) Approver
      
    4. Finally add this statement  to the WHERE clause: 

      AND Header.PO_HEADER_ID = Approver.OBJECT_ID(+)
      

       

    With these changes, the data model will include the approver name and username. You can use the approver name in the RTF template right now, and we cover how to use the username to add a signature in this post.

    Document: