{"id":30986,"date":"2025-06-30T09:54:58","date_gmt":"2025-06-30T09:54:58","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=30986"},"modified":"2025-06-30T09:54:58","modified_gmt":"2025-06-30T09:54:58","slug":"making-sage-x3-reports-dynamic-with-miscellaneous-tables-ar-ap-report-filtering-without-sql-changes","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/06\/30\/making-sage-x3-reports-dynamic-with-miscellaneous-tables-ar-ap-report-filtering-without-sql-changes\/","title":{"rendered":"Making Sage X3 Reports Dynamic with Miscellaneous Tables: AR\/AP Report Filtering Without SQL Changes"},"content":{"rendered":"\n<p>Miscellaneous Tables 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> offer a powerful way to make reports dynamic, user-friendly, and low-maintenance. This approach is especially beneficial for reports that require customizable filters such as account codes, cost centers, item categories, and more.<br>Sage X3 provides developers with a robust feature known as Miscellaneous Tables\u2014logical tables used to store codes or lists of values such as rules, terms, payment methods, account codes, etc. These tables are particularly useful when you need to present users with dropdown options that ensure strict data integrity.<\/p>\n\n\n\n<p>Recently, we received a requirement from one of our clients who needed an AP\/AR transaction report filtered by specific account codes. A common challenge when working with Accounts Receivable (AR) and Accounts Payable (AP) reports in Sage X3 is applying filters based on account codes. Traditionally, this is handled using hardcoded values in SQL queries, which becomes a maintenance burden whenever the list of accounts changes.<\/p>\n\n\n\n<p>In this blog, we\u2019ll share a smarter and more dynamic solution we implemented using Miscellaneous Tables in Sage X3. This method removes the need for hardcoded account numbers and allows users to manage filter values themselves\u2014without requiring any changes to the underlying report logic.<\/p>\n\n\n\n<p><strong>Step 1: Create a Miscellaneous Table<\/strong><\/p>\n\n\n\n<p><strong>Define the Table<\/strong><\/p>\n\n\n\n<p>Navigate to the following path in Sage X3 to create and validate a new Miscellaneous Table.<br>Defining the table involves specifying its structure, including fields (columns), their data types, and any constraints. Refer to the screenshot below for guidance:<\/p>\n\n\n\n<p>Path: All > Development > Data and Parameters > Miscellaneous Tables > Definition<\/p>\n\n\n\n<p><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/06\/30\/how-to-read-json-using-json-parsing-4gl-functions-in-sage-x3\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/06\/30\/how-to-read-json-using-json-parsing-4gl-functions-in-sage-x3\/\" rel=\"noreferrer noopener\">How to Read JSON Using JSON Parsing 4GL Functions in Sage X3<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/06\/Figure-01-Miscellaneous-Table-Definition-1-1024x552.png\" target=\"_blank\" rel=\"noreferrer noopener\"><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\/2025\/06\/Figure-01-Miscellaneous-Table-Definition-1-1024x552.png\" alt=\"Figure 01 - Miscellaneous Table Definition\n\"><\/a><\/center>\n<font size=\"2\"><center>Figure 01 &#8211; Miscellaneous Table Definition\n<\/center><\/font>\n\n\n\n<p><strong>Add Data to the Table<\/strong><\/p>\n\n\n\n<p>Adding data involves inserting records (rows) into the table based on the structure defined in Step 1. This is where you populate the table with actual values. Here in our case we\u2019ve added the account codes. Find the below screenshot for your reference.<\/p>\n\n\n\n<p><strong>Path:<\/strong> All > Development > Data and Parameters > Miscellaneous Tables > Data<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/06\/Figure-02-Miscellaneous-Table-Data-1024x568.png\" target=\"_blank\" rel=\"noreferrer noopener\"><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\/2025\/06\/Figure-02-Miscellaneous-Table-Data-1024x568.png\" alt=\"Figure 02 - Miscellaneous Table Data\"><\/a><\/center>\n<font size=\"2\"><center>Figure 02 &#8211; Miscellaneous Table Data<\/center><\/font>\n\n\n\n<p><strong>Step 2: Modify the SQL Query to Use Miscellaneous Table<\/strong><\/p>\n\n\n\n<p>Open the Crystal Report query and add the Miscellaneous Table code in the WHERE condition to compare the account values with those in the main JV table. In the AR report, we are capturing data from the Journal Entry screen, where the account numbers are stored in the GACCNTRYD table. Now, in the WHERE condition, we will compare the account numbers from the GACCNTRYD table with those stored in the newly created Miscellaneous Table, which contains user-specific account codes. In Sage X3, the Miscellaneous Table code and data are stored in the ATABDIV table.<br>Please refer to the screenshot below for your reference.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/06\/Figure-03-SQL-Query-1024x304.png\" target=\"_blank\" rel=\"noreferrer noopener\"><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\/2025\/06\/Figure-03-SQL-Query-1024x304.png\" alt=\"Figure 03- SQL Query\"><\/a><\/center>\n<font size=\"2\"><center>Figure 03- SQL Query<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/06\/Figure-04-Output-1024x546.png\" target=\"_blank\" rel=\"noreferrer noopener\"><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\/2025\/06\/Figure-04-Output-1024x546.png\" alt=\"Figure 04 - Output\"><\/a><\/center>\n<font size=\"2\"><center>Figure 04 &#8211; Output<\/center><\/font>\n\n\n\n<p>By implementing this solution, we transformed the AP\/AR report into a dynamic one based on specific account code filters. By using Miscellaneous Tables, the client can now independently update the list of account codes, and the same report continues to deliver accurate results\u2014without requiring any code changes.<\/p>\n\n\n[about_us_blog_common]\n","protected":false},"excerpt":{"rendered":"<p>Miscellaneous Tables in Sage X3 offer a powerful way to make reports dynamic, user-friendly, and low-maintenance. This approach is especially beneficial for reports that require customizable filters such as account codes, cost centers, item categories, and more.Sage X3 provides developers with a robust feature known as Miscellaneous Tables\u2014logical tables used to store codes or lists\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/06\/30\/making-sage-x3-reports-dynamic-with-miscellaneous-tables-ar-ap-report-filtering-without-sql-changes\/\">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":[4392,461,1288,1822,3485],"class_list":["post-30986","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","category-integration","tag-ar-accounts-receivable","tag-crystal-report","tag-miscellaneous-tables","tag-sage-x3","tag-sql"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30986","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=30986"}],"version-history":[{"count":10,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30986\/revisions"}],"predecessor-version":[{"id":30996,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/30986\/revisions\/30996"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=30986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=30986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=30986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}