{"id":32664,"date":"2026-09-29T12:49:06","date_gmt":"2026-09-29T12:49:06","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=32664"},"modified":"2026-09-29T12:49:06","modified_gmt":"2026-09-29T12:49:06","slug":"how-to-dynamically-change-field-labels-based-on-entry-transaction-in-sage-x3-using-gflag-and-chgtzn","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/09\/29\/how-to-dynamically-change-field-labels-based-on-entry-transaction-in-sage-x3-using-gflag-and-chgtzn\/","title":{"rendered":"How to Dynamically Change Field Labels Based on Entry Transaction in Sage X3 (Using GFLAG and Chgtzn)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><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> is a highly flexible ERP system that allows businesses to configure transaction screens according to their specific processes. One of the most powerful features in Sage X3 is the Entry Transaction concept. Using <strong>Entry Transactions<\/strong>, the same document (such as Stock Change, Sales Order, Purchase Order, etc.) can behave differently based on the selected transaction code \u2014 fields can be hidden, displayed, made enterable, or even show different labels.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In real-life implementations, it is very common that the same physical field on a screen needs to represent different business meanings depending on the process being performed. Instead of creating multiple fields or multiple screens, Sage X3 provides a simple and elegant way to dynamically change the <strong>label<\/strong> of a field at runtime using the GFLAG variable and the Chgtzn instruction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Requirement from Client &#8211;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Recently we received a requirement from one of our clients related to the <strong>Stock Change<\/strong> screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the Stock Change screen, there is a field called <strong>Allocation Date <\/strong>(IPTDAT).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same screen has multiple Entry Transactions. The client\u2019s requirement was:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022When the Entry Transaction is <strong>ZDEL<\/strong> (Delivery related), the field label should appear as \u201c<strong>DC Date<\/strong>\u201d<br>\u2022When the Entry Transaction is <strong>ZRCPT<\/strong> (Receipt related), the field label should appear as \u201c<strong>RCP Date<\/strong>\u201d<br>\u2022For all other Entry Transactions, the label should remain as \u201c<strong>Allocation Date<\/strong>\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/09\/29\/streamlining-internal-and-capital-project-management-in-sage-x3-with-separate-project-sequences\/\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/09\/29\/streamlining-internal-and-capital-project-management-in-sage-x3-with-separate-project-sequences\/\" target=\"_blank\" rel=\"noreferrer noopener\">Streamlining Internal and Capital Project Management in Sage X3 with Separate Project Sequences<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-01-Stock-Change-Screen-1024x207.png\" target=\"_blank\" rel=\"noreferrer \nnoopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; \nalign: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-01-Stock-Change-Screen-1024x207.png\" alt=\"Figure 01 - Stock Change Screen\"><\/a><\/center> \n<font size=\"2\"><center>Figure 01 &#8211; Stock Change Screen<\/center><\/font>\n\n\n\n<p class=\"wp-block-paragraph\">In Sage X3, we can easily achieve this by checking the value of the global variable GFLAG (which stores the current Entry Transaction code) and then using the Chgtzn instruction to change the field label dynamically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Understanding the Key Concepts<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022<strong>GFLAG: <\/strong>This variable holds the code of the currently selected Entry Transaction (for example: ALL, ZDEL, ZRCPT, etc.).<br>\u2022<strong>Chgtzn: <\/strong>This is a 4GL instruction used to change the title (label) of a field on the screen.<br>\u2022<strong>Syntax:<\/strong><br>Chgtzn [M:ScreenCode]FieldCode With &#8220;New Label&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the code that achieves the requirement:<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-02-\u2013-Reference-Code.png\" target=\"_blank\" rel=\"noreferrer \nnoopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; \nalign: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-02-\u2013-Reference-Code.png\" alt=\"Figure 02 \u2013 Reference Code\"><\/a><\/center> \n<font size=\"2\"><center>Figure 02 \u2013 Reference Code<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-03-\u2013-Delivery-Entry-Transaction-Output-1024x200.png\" target=\"_blank\" rel=\"noreferrer \nnoopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; \nalign: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-03-\u2013-Delivery-Entry-Transaction-Output-1024x200.png\" alt=\"Figure 03 \u2013 Delivery Entry Transaction Output\"><\/a><\/center> \n<font size=\"2\"><center>Figure 03 \u2013 Delivery Entry Transaction Output<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-04-\u2013-Receipt-Entry-Transaction-Output-1024x197.png\" target=\"_blank\" rel=\"noreferrer \nnoopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; \nalign: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/09\/Figure-04-\u2013-Receipt-Entry-Transaction-Output-1024x197.png\" alt=\"Figure 04 \u2013 Receipt Entry Transaction Output\"><\/a><\/center> \n<font size=\"2\"><center>Figure 04 \u2013 Receipt Entry Transaction Output<\/center><\/font>\n\n\n\n<p class=\"wp-block-paragraph\">Dynamically changing field labels using GFLAG and Chgtzn is a simple yet very effective technique in Sage X3. It allows consultants to meet client-specific requirements without creating extra fields or complex screen customizations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the above example, we successfully changed the meaning of the Allocation Date field on the Stock Change screen based on the selected Entry Transaction \u2014 showing \u201cDC Date\u201d for delivery, \u201cRCP Date\u201d for receipt, and \u201cAllocation Date\u201d for other processes \u2014 exactly as requested by the client.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-1\" style=\"color:#c71d22\"><strong>About Us<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Greytrix \u2013 a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"block-28013e99-0882-44c6-b705-7b16c85053b2\">Greytrix&nbsp;has some unique integration solutions developed for&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-crm\/\">Sage CRM<\/a>&nbsp;with Sage ERPs&nbsp;namely&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\">Sage X3<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-intacct\/\">Sage Intacct<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-100-erp\/\">Sage 100<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-500-erp\/\">Sage 500<\/a>,&nbsp;and&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">Sage 300<\/a>. We also offer best-in-class&nbsp;Sage ERP&nbsp;and&nbsp;Sage CRM&nbsp;customization and development services&nbsp;to&nbsp;Business&nbsp;Partners,&nbsp;End&nbsp;Users, and Sage PSG worldwide. Greytrix&nbsp;helps in&nbsp;the migration of Sage CRM from&nbsp;Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes&nbsp;addons like&nbsp;&nbsp;Greytrix Business Manager,&nbsp;Sage CRM Project Manager,&nbsp;Sage CRM Resource Planner,&nbsp;Sage CRM Contract Manager,&nbsp;Sage CRM Event Manager,&nbsp;Sage CRM Budget Planner,&nbsp;Gmail Integration,&nbsp;Sage CRM Mobile Service Signature,&nbsp;Sage CRM CTI Framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"block-4bc42a09-fb13-4598-8137-ce5f7b91ce28\">Greytrix is a recognized&nbsp;Sage Champion Partner&nbsp;for GUMU&#x2122; Sage X3 \u2013 Sage CRM integration listed on&nbsp;<a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Marketplace<\/a>&nbsp;and Sage CRM \u2013 Sage Intacct integration listed on&nbsp;<a href=\"https:\/\/marketplace.intacct.com\/MPListing?lid=a2D0H000007kiHyUAI\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Cloud framework<\/a>&nbsp;by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"block-76376301-1c3e-4250-8a09-727595a606f0\">For more information on our integration solutions, please contact us at&nbsp;<a href=\"mailto:sage@greytrix.com\">sage@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sage X3 is a highly flexible ERP system that allows businesses to configure transaction screens according to their specific processes. One of the most powerful features in Sage X3 is the Entry Transaction concept. Using Entry Transactions, the same document (such as Stock Change, Sales Order, Purchase Order, etc.) can behave differently based on the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/09\/29\/how-to-dynamically-change-field-labels-based-on-entry-transaction-in-sage-x3-using-gflag-and-chgtzn\/\">Read More: How to Dynamically Change Field Labels Based on Entry Transaction\u2026 &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":[8,13],"tags":[4733,714,890,1822,4586],"class_list":["post-32664","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","category-integration","tag-chgtzn","tag-entry-transaction","tag-gflag","tag-sage-x3","tag-stock-change"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32664","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=32664"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32664\/revisions"}],"predecessor-version":[{"id":32692,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32664\/revisions\/32692"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=32664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=32664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=32664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}