{"id":32819,"date":"2026-11-23T09:49:56","date_gmt":"2026-11-23T09:49:56","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=32819"},"modified":"2026-11-23T09:49:56","modified_gmt":"2026-11-23T09:49:56","slug":"automating-gl-credit-account-based-on-reason-code-in-sage-x3-miscellaneous-receipts","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/11\/23\/automating-gl-credit-account-based-on-reason-code-in-sage-x3-miscellaneous-receipts\/","title":{"rendered":"Automating GL Credit Account based on Reason Code in Sage X3 Miscellaneous Receipts"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the standard <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> process, Miscellaneous Receipt entries are accounted for in the General Ledger through predefined accounts maintained in the Automatic Journal (commonly STKEN). Although this method is suitable for regular scenarios, it lacks the flexibility to determine the credit account based on a user-selected Reason Code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A recent client requirement, When a Miscellaneous Receipt is created and the Account Interface is run, the credit line in the resulting GL entry should use the Account Code linked to the Reason Code selected by the user on the receipt screen (instead of a fixed standard account). &nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We implemented configurable solution using a Miscellaneous Table + custom field mapping in the Automatic Journal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1 : . Reason Code &amp; Account Code Mapping (Miscellaneous Table 19138)<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; A new Miscellaneous Table 19138 \u2013 Reason Code for misc issue was created.- Users maintain the mapping here (Code \u2192 Description \u2192 Account Code in Short description). Please see Fig 1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; A new Miscellaneous Table 19138 \u2013 Reason Code for misc issue was created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Users maintain the mapping here (Code \u2192 Description \u2192 Account Code in Short description). Please see Fig 1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">New Stuff:- <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/11\/23\/how-to-decode-base64-to-a-file-in-sage-x3-using-4gl\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/11\/23\/how-to-decode-base64-to-a-file-in-sage-x3-using-4gl\/\" rel=\"noreferrer noopener\">How to Decode Base64 to a File in Sage X3 Using 4GL<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/11\/image.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\/11\/image.png\" alt=\"Fig1. Miscellaneous Table 19138\"><\/a><\/center>\n<font size=\"2\"><center>Fig1. Miscellaneous Table 19138<\/center><\/font>\n\n\n\n<p class=\"wp-block-paragraph\">This table becomes the single source of truth. Finance or master-data teams can add or change mappings without any development.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2 : Entry Creation \u2013 Automatic Population of Account Code<\/strong> <strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On the Miscellaneous Receipts screen (Misc Stock Receipts Full Entry):<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&#8211; User selects the Reason using the finder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&#8211; The system automatically populates the corresponding Account Code in the product line (from the mapping maintained in table 19138). &nbsp;Please see Fig 2<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/11\/image-1.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\/11\/image-1.png\" alt=\"Fig2. Miscellaneous Receipt\"><\/a><\/center>\n<font size=\"2\"><center>Fig2. Miscellaneous Receipt<\/center><\/font>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3 : GL Posting via Automatic Journal (STKEN)<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;The key technical step was to make the Automatic Journal pick up the Account Code stored on the receipt line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;In Automatic Journals \u2192 STKEN \u2192 Formulas tab:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&#8211; On the Stock variation line (the credit line \u2013 usually line 2 &amp; 3 )<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&#8211; For the field Account Legal &gt;&gt; Account Legal &gt;&gt; The formula was set to: num$([F:SMD]ZACC). Please see Fig 3 &nbsp;(Stock variation line 2 )&nbsp;&#8211; For the field Account Legal &gt;&gt; Account Legal &gt;&gt; The formula was set to: num$([F:SMD]ZACC). Please see Fig 4 &nbsp;(Stock adjustment line 3)<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/11\/image-2.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\/11\/image-2.png\" alt=\"Fig 3. Automatic Journals (STKEN) 2 line\"><\/a><\/center>\n<font size=\"2\"><center>Fig 3. Automatic Journals (STKEN) 2 line<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/11\/image-3.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\/11\/image-3.png\" alt=\"Fig 4. Automatic Journals (STKEN) 3 line\"><\/a><\/center>\n<font size=\"2\"><center>Fig 4. Automatic Journals (STKEN) 3 line<\/center><\/font>\n\n\n\n<p class=\"wp-block-paragraph\">This formula reads the Account Code field (ZACC) from the Miscellaneous Receipt detail line and passes it to the GL entry.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After running the Account Interface, the generated journal clearly shows the dynamic accounts:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Debit lines use the standard inventory \/ stock accounts. &#8211; Credit lines use the Reason-driven accounts (1101000, 1101100, etc.) exactly as selected by the user on the receipt. Please see Fig 5<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2026\/11\/image-4.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\/11\/image-4.png\" alt=\"Fig 5. Journal Entry\"><\/a><\/center>\n<font size=\"2\"><center>Fig 5. Journal Entry<\/center><\/font>\n\n\n\n<h2 class=\"wp-block-heading\"><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\">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\">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=\"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=\"noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"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\">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>In the standard Sage X3 process, Miscellaneous Receipt entries are accounted for in the General Ledger through predefined accounts maintained in the Automatic Journal (commonly STKEN). Although this method is suitable for regular scenarios, it lacks the flexibility to determine the credit account based on a user-selected Reason Code. A recent client requirement, When a\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2026\/11\/23\/automating-gl-credit-account-based-on-reason-code-in-sage-x3-miscellaneous-receipts\/\">Read More: Automating GL Credit Account based on Reason Code in Sage\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":32822,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,8],"tags":[3021,2709,176,4761,1287,4760,1822,4759],"class_list":["post-32819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integration","category-sage-erp-x3","tag-account-code","tag-accounting-interface","tag-automatic-journal","tag-gl-posting","tag-miscellaneous-receipt","tag-reason-code","tag-sage-x3","tag-stken"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32819","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=32819"}],"version-history":[{"count":7,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32819\/revisions"}],"predecessor-version":[{"id":32831,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/32819\/revisions\/32831"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media\/32822"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=32819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=32819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=32819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}