{"id":30919,"date":"2025-05-30T13:26:30","date_gmt":"2025-05-30T13:26:30","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=30919"},"modified":"2025-05-30T13:26:30","modified_gmt":"2025-05-30T13:26:30","slug":"how-to-change-screen-title-using-code-in-sage-x3","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/05\/30\/how-to-change-screen-title-using-code-in-sage-x3\/","title":{"rendered":"How to Change Screen Title Using Code in Sage X3"},"content":{"rendered":"\n<p>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> development, there are scenarios where developers need to change the screen title dynamically\u2014either based on certain conditions or to avoid hardcoding changes through the development window. Fortunately, Sage X3 provides a way to do this through the Chgtfd instruction.<\/p>\n\n\n\n<p>In this blog, we&#8217;ll explore how to change a screen title using the Chgtfd keyword in Sage X3, with examples and best practices.<\/p>\n\n\n\n<p><strong>What is Chgtfd?<\/strong><\/p>\n\n\n\n<p>The Chgtfd command in Sage X3 is used to change the title of a tab associated with a mask in a window. This is particularly helpful when:<\/p>\n\n\n\n<p>You don\u2019t want to change the screen title manually via the development window.<\/p>\n\n\n\n<p>You want to display a dynamic title based on user input or specific conditions at runtime.<\/p>\n\n\n\n<p><strong>Syntax of Chgtfd<\/strong><\/p>\n\n\n\n<p>Chgtfd [CLASS] TITLE<\/p>\n\n\n\n<p><strong>Parameters:<\/strong><br>[CLASS]: The abbreviation used for the mask. If omitted, the default mask is used.<\/p>\n\n\n\n<p>TITLE: A string expression that represents the new title to be displayed.<\/p>\n\n\n\n<p><strong>Note:<\/strong> If you pass a blank string (&#8220;&#8221;) as the title, Sage X3 will display the default title configured in the screen design.<\/p>\n\n\n\n<p><strong>Example:<\/strong><br>Let\u2019s say we have a screen titled &#8220;TEST DETAIL SCREEN&#8221;, and we want to change it to &#8220;NEW SCREEN TITLE&#8221; at runtime.<\/p>\n\n\n\n<p><strong>Here\u2019s how the code looks:<\/strong><br>Chgtfd [M:ZTESTD] &#8220;NEW SCREEN TITLE&#8221;<\/p>\n\n\n\n<p><strong>New Stuff: <\/strong><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/05\/30\/postal-code-customization-in-customer-and-supplier-master-in-sage-x3\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/05\/30\/postal-code-customization-in-customer-and-supplier-master-in-sage-x3\/\" rel=\"noreferrer noopener\">Postal code customization in Customer and Supplier master in Sage X3.<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/05\/Before-changing-screen-title-1024x423.png\" 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\/05\/Before-changing-screen-title-1024x423.png\" alt=\"Before changing screen title\"><\/a><\/center>\n<font size=\"2\"><center>Before changing screen title<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/05\/After-changing-screen-title-1024x420.png\" 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\/05\/After-changing-screen-title-1024x420.png\" alt=\"After changing screen title\"><\/a><\/center>\n<font size=\"2\"><center>After changing screen title<\/center><\/font>\n\n\n\n<p><strong>Practical Use Case<\/strong><br>Imagine you&#8217;re developing a custom screen where the title needs to reflect the type of transaction or user role. Instead of creating multiple screens or relying on static titles, you can simply write logic to update the title dynamically using Chgtfd.<\/p>\n\n\n\n<p>If GUSER = &#8220;ADMIN&#8221;<br>   Chgtfd [M:ZTESTD] &#8220;Admin View &#8211; Transaction Details&#8221;<br>Else<br>   Chgtfd [M:ZTESTD] &#8220;User View &#8211; Transaction Details&#8221;<br>Endif<\/p>\n\n\n\n<p><strong>Final Notes:<\/strong><br>Chgtfd is a powerful tool for dynamic UI customization in Sage X3.<br>Always ensure the mask abbreviation is correct to avoid runtime errors.<br>Avoid overusing this command unnecessarily, as too many dynamic changes can confuse users.<\/p>\n\n\n[about_us_blog_common]\n","protected":false},"excerpt":{"rendered":"<p>In Sage X3 development, there are scenarios where developers need to change the screen title dynamically\u2014either based on certain conditions or to avoid hardcoding changes through the development window. Fortunately, Sage X3 provides a way to do this through the Chgtfd instruction. In this blog, we&#8217;ll explore how to change a screen title using the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/05\/30\/how-to-change-screen-title-using-code-in-sage-x3\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,13],"tags":[4379,4378,4380,4377,4381,4382],"class_list":["post-30919","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","category-integration","tag-change-screen-title","tag-chgtfd","tag-chgtfd-in-sage-x3","tag-screen-title","tag-syntax-of-chgtfd","tag-what-is-chgtfd"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30919","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=30919"}],"version-history":[{"count":4,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30919\/revisions"}],"predecessor-version":[{"id":30923,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30919\/revisions\/30923"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=30919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=30919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=30919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}