{"id":31680,"date":"2025-12-31T13:11:23","date_gmt":"2025-12-31T13:11:23","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=31680"},"modified":"2026-01-02T10:19:19","modified_gmt":"2026-01-02T10:19:19","slug":"triggering-a-workflow-in-sage-x3-when-comments-change-in-a-purchase-order","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/12\/31\/triggering-a-workflow-in-sage-x3-when-comments-change-in-a-purchase-order\/","title":{"rendered":"Triggering a Workflow in Sage X3 When Comments Change in a Purchase Order"},"content":{"rendered":"\n<p>We implemented a Purchase Order (PO) signature workflow in <a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/development-services\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/sage-x3-erp\/development-services\/\" rel=\"noreferrer noopener\">Sage X3<\/a> for a client where, when a user creates a PO and clicks the \u201cSend for approval\u201d button, the workflow automatically routes it to the assigned approver.<\/p>\n\n\n\n<p>The client later requested an enhancement: whenever a user makes any modification in the Comments section of an existing PO, the workflow should be triggered again \u2014 regardless of whether it has already been sent for approval or approved.<\/p>\n\n\n\n<p><strong>Steps to Implement the Requirement:<\/strong><\/p>\n\n\n\n<p>To achieve the above requirement, we implemented the following steps:<\/p>\n\n\n\n<p><strong>Step 1:<\/strong><br>Added a custom field \u2018Comment Modified\u2019 on the Purchase Order (PO) header screen. This field is display-only and uses local menu 1 to hold the values \u2018Yes\u2019 or \u2018No\u2019.<\/p>\n\n\n\n<p><strong>New Stuff: <\/strong><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/12\/31\/how-to-show-multi-line-text-in-sage-x3-2\/\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/12\/31\/how-to-show-multi-line-text-in-sage-x3-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Enable or Disable Electronic Signature in Portugal for Companies<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig1-Purchase-Order-screen-1024x377.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig1-Purchase-Order-screen-1024x377.jpg\" alt=\"fig 1 Purchase Order screen\"><\/a><\/center>\n<font size=\"2\"><center>fig 1 Purchase Order screen<\/center><\/font>\n\n\n\n<p><strong>Step 2:<\/strong><br>Created a custom miscellaneous-type Action named ZCOMNT, using the Standard processing template and other relevant parameters as shown in the screenshot below.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig2-ZCOMNT-Action-1024x505.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig2-ZCOMNT-Action-1024x505.jpg\" alt=\"fig 2 ZCOMNT Action\"><\/a><\/center>\n<font size=\"2\"><center>fig 2 ZCOMNT Action<\/center><\/font>\n\n\n\n<p><strong>Step 3:<\/strong><br>Opened the Comments window (AOBJCOM) and assigned the ZCOMNT action to the predefined \u2018OK\u2019 button, as shown in the screenshot below. Then saved the configuration and performed a global validation of the window.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig3-Comments-Window.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/12\/fig3-Comments-Window.jpg\" alt=\"fig 3 Comments Window\"><\/a><\/center>\n<font size=\"2\"><center>fig 3 Comments Window<\/center><\/font>\n\n\n\n<p><strong>Step 4:<br><\/strong>Added 4GL code in the XYZCOMNT specific script to check whether the current screen is a Purchase Order.<\/p>\n\n\n\n<p>If the screen corresponds to a PO and a change is made in the Comments section, the script updates the \u2018Comment Modified\u2019 field to \u2018Yes\u2019 and sets the Signed flag to 0, which re-enables the \u2018Send for approval\u2019 button on the PO screen. Otherwise, it sets the value to \u2018No\u2019.<\/p>\n\n\n\n<p><strong>Step 5:<\/strong><br>Once the \u2018Send for approval\u2019 button is re-enabled, the user can resend the PO for approval, continuing the workflow process as usual.<\/p>\n\n\n\n<p>We handle this scenario in this way because, before the entry is created, the Comment field is not editable. After the entry is created, users can add or modify comments, but these changes cannot be saved using the standard Save button. When the user enters a comment and clicks \u2018OK\u2019, the comment is automatically saved to the ACLOB table along with the corresponding reference number.<\/p>\n\n\n\n<p><strong>Conclusion:<\/strong><br>By implementing the above configuration and 4GL customization, we successfully enabled the Purchase Order workflow in Sage X3 to automatically re-trigger whenever comments are added or modified.<\/p>\n\n\n\n<p>This enhancement ensures that any updates to the Comments section\u2014often containing critical information or justifications\u2014are reviewed and approved through the established approval process. It not only improves workflow accuracy and compliance, but also strengthens control over PO modifications, ensuring full transparency and accountability in procurement operations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We implemented a Purchase Order (PO) signature workflow in Sage X3 for a client where, when a user creates a PO and clicks the \u201cSend for approval\u201d button, the workflow automatically routes it to the assigned approver. The client later requested an enhancement: whenever a user makes any modification in the Comments section of an\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/12\/31\/triggering-a-workflow-in-sage-x3-when-comments-change-in-a-purchase-order\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-31680","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=31680"}],"version-history":[{"count":5,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31680\/revisions"}],"predecessor-version":[{"id":31703,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31680\/revisions\/31703"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=31680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=31680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=31680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}