{"id":1284,"date":"2024-01-17T06:08:58","date_gmt":"2024-01-17T06:08:58","guid":{"rendered":"https:\/\/www.aegissofttech.com\/insights\/?p=1284"},"modified":"2026-05-22T14:19:22","modified_gmt":"2026-05-22T14:19:22","slug":"hide-messages-in-purcase-documents-business-central","status":"publish","type":"post","link":"https:\/\/www.aegissofttech.com\/insights\/hide-messages-in-purcase-documents-business-central\/","title":{"rendered":"How to Hide Messages in Purchase Documents in Business Central"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Every Business Central developer or consultant has faced it: you\u2019re testing a purchase order, hit Post, and a validation message pops up. Then another. And another.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each one halts your flow and demands attention, even when you already know what it\u2019s trying to say. These constant interruptions can turn a simple purchase entry into a frustrating task.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In many cases, teams need a way to hide messages in purchase documents that are repetitive or contextually irrelevant without compromising data integrity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide addresses the problem with both built-in options and AL code customizations. Let\u2019s dive in!<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Key Takeaways<\/strong><\/p>\n\n\n\n<div style=\"border:1px solid #000; padding:15px; margin:20px 0;\">\nFollow these steps to hide messages in purchase documents:\n<ul style=\"margin-top:10px; line-height:1.6;\">\n<li><b>Select messages to suppress:<\/b> Target only non-critical warnings like Order Date earlier than Work Date<\/li>\n<li><b>Create a table extension:<\/b> Add an OnBeforeValidate trigger on the relevant Purchase Line field and call Rec.SetHideValidationDialog(true)<\/li>\n<li><b>Deploy and activate:<\/b> Publish to sandbox or production and confirm the extension is active<\/li>\n<li><b>Test thoroughly:<\/b> Validate single and bulk orders, recurring entries, and linked workflows to avoid errors<\/li>\n<li><b>Document and monitor:<\/b> Record suppressed messages and AL code, then review logs and user feedback to ensure no critical issues are hidden<\/li>\n<\/ul>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What Triggers Validation Messages in Purchase Documents<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"525\" src=\"https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document-1024x525.webp\" alt=\"Order date is earlier than work date in the purchase document\n\" class=\"wp-image-19580\" title=\"Order date is earlier than work date in the purchase document\" srcset=\"https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document-1024x525.webp 1024w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document-300x154.webp 300w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document-768x394.webp 768w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document-1536x788.webp 1536w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Order-date-is-earlier-than-work-date-in-the-purchase-document.webp 1751w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In Dynamics 365 Business Central, purchase documents like orders, invoices, and receipts rely on field-level validation to maintain data consistency across modules. Each time a user edits or enters a value, the system checks whether it aligns with underlying business rules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common examples include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u2018Order Date is earlier than the Work Date\u2019 <\/strong>appears when the document date precedes the active work date<\/li>\n\n\n\n<li><strong>\u2018Vendor No. must have a value in Purchase Header\u2019 <\/strong>is<strong> <\/strong>triggered if a user tries to post a document without selecting a vendor<\/li>\n\n\n\n<li><strong>\u2018Direct Unit Cost must be positive\u2019<\/strong> is shown when the unit cost field is blank or negative<\/li>\n\n\n\n<li>&#8216;<strong>Posting Date is not within your allowed posting range\u2019 <\/strong>occurs when the date falls outside the permitted accounting periods<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box-1024x545.webp\" alt=\" Validation message for purchase order date dialog box\" class=\"wp-image-19581\" title=\" Validation message for purchase order date dialog box\" srcset=\"https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box-1024x545.webp 1024w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box-300x160.webp 300w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box-768x409.webp 768w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box-1536x818.webp 1536w, https:\/\/www.aegissofttech.com\/insights\/wp-content\/uploads\/2024\/01\/Validation-message-for-purchase-order-date-dialog-box.webp 1719w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Built-in Features for Message Suppression<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Business Central includes several built-in options to manage or reduce validation messages in purchase documents without touching code. These features help improve user experience while maintaining control over critical checks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Key built-in methods often used by <a href=\"https:\/\/www.aegissofttech.com\/dynamics-365\/business-central-consulting\" target=\"_blank\" rel=\"noreferrer noopener\">Business Central consultants<\/a> include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set hide validation dialogs in user personalization:<\/strong> Users can temporarily suppress repetitive warnings for their session, reducing interruptions during bulk data entry<\/li>\n\n\n\n<li><strong>Use posting setup options:<\/strong> Certain validations, like warnings on dates or inventory issues, can be adjusted via posting setup to avoid unnecessary prompts<\/li>\n\n\n\n<li><strong>Document-specific options:<\/strong> On some purchase documents, fields such as Order Date or Posting Date can be prefilled or auto-adjusted to meet validation rules, preventing dialogs from appearing<\/li>\n\n\n\n<li><strong>Configure workflow approvals:<\/strong> Defined approval rules let administrators control which changes trigger messages, ensuring only critical alerts reach the user<\/li>\n<\/ul>\n\n\n\n<div style=\"border:1px solid #000; padding:15px; margin:20px 0;\">\n<b>From the Aegis Project Desk:<\/b> These built-in tools work well for common scenarios where dialogs are predictable or repetitive. However, they have limitations. Complex validations, conditional warnings, or organization-specific rules often require an AL-based solution.\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Step-by-Step AL Code Example to Hide Purchase Document Messages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s a step-by-step approach to hide messages in purchase documents using AL code and the SetHideValidationDialog method.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step #1: Create a Table Extension<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before suppressing messages, we need to extend the purchase line table. This allows you to add custom logic without altering the base system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Visual Studio Code, create a table extension for <strong>Purchase Line<\/strong> and add a trigger on the field you want to control, such as <strong>Order Date<\/strong>. Within the OnBeforeValidate trigger, call Rec.SetHideValidationDialog(true). This ensures the validation dialog for the selected field is suppressed while keeping other system validations intact.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tableextension 50100 PurchaseLineExt extends \"Purchase Line\"\n{\n    fields\n    {\n        modify(\"Order Date\")\n        {\n            trigger OnBeforeValidate()\n            begin\n                Rec.SetHideValidationDialog(true);\n            end;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step #2: Deploy the Extension<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After creating the table extension, publish it to your sandbox or production environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the <strong>Extensions<\/strong> page in Business Central to confirm the extension is active. Deploying to a sandbox first allows you to test without disrupting ongoing workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once deployed, the modified behavior will be active, and the targeted validation message will no longer interrupt users during data entry.<\/p>\n\n\n    \t<section class=\"call-to-action-section\">\n    \t\t<div class=\"call-to-action-container\">\n    \t\t\t<div class=\"call-to-action-body\">\n    \t\t\t\t<div class=\"cta-title\"><\/div>\n    \t\t\t\t<p><\/p>\n<div style='text-align:left; color:white;'>\n<b>Pro Tip:<\/b> Focus suppression on scenarios where repeated warnings slow down bulk entry or recurring transactions rather than one-off entries.<\/div>\n<p><\/p>\n    \t\t\t<\/div>\n    \t\t\t    \t\t<\/div>\n    \t<\/section>\n    \n\n\n\n<h3 class=\"wp-block-heading\">Step #3: Test the Suppressed Message<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Testing ensures the suppression works correctly and other processes remain unaffected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new purchase order and enter an <strong>Order Date<\/strong> earlier than the <strong>Work Date<\/strong>. You should notice that the validation message does not appear, allowing uninterrupted entry. At the same time, verify that other fields continue enforcing their validations and that the purchase order can be posted without errors.<\/p>\n\n\n\n<section class=\"call-to-action-section\">\n<div class=\"call-to-action-container\">\n<div class=\"call-to-action-body\">\n<div class=\"cta-title\"><\/div>\n<p><\/p>\n<div style=\"text-align:center; color:white;\">\n<strong>Also Read:<\/strong> <a href=\"https:\/\/www.aegissofttech.com\/insights\/ai-for-business-central-developers\/\" target=\"_blank\">The Ultimate Guide to AI for Business Central Developers<\/a><\/div>\n<p><\/p>\n<\/div>\n<\/div>\n<\/section>\n\n\n\n<h3 class=\"wp-block-heading\">Step #4: Evaluate Use Cases and Limitations<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Suppressing messages can improve workflow efficiency, but it comes with trade-offs. This method is best suited for non-critical warnings that frequently interrupt users, such as date warnings in purchase lines.<\/p>\n\n\n    \t<section class=\"call-to-action-section\">\n    \t\t<div class=\"call-to-action-container\">\n    \t\t\t<div class=\"call-to-action-body\">\n    \t\t\t\t<div class=\"cta-title\"><\/div>\n    \t\t\t\t<p><\/p>\n<div style='text-align:left; color:white;'>\n<b>Pro Tip:<\/b> Be mindful that suppressing certain messages can hide potential data inconsistencies. Always document which validations have been suppressed to maintain clarity for team members and future developers.<\/div>\n<p><\/p>\n    \t\t\t<\/div>\n    \t\t\t    \t\t<\/div>\n    \t<\/section>\n    \n\n\n\n<h3 class=\"wp-block-heading\">Step #5: Maintain and Extend<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once one field works as expected, the same approach can be applied to other purchase document fields that generate repetitive warnings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep a reference of all suppressed validations and review them periodically to ensure core business rules remain enforced. This method provides a controlled way to hide messages in Business Central purchase documents.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices When Hiding Validation Messages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Suppressing validation messages in Business Central<strong><em> <\/em><\/strong>can streamline purchase document entry, but it requires careful planning to avoid hidden errors. Here\u2019s how to do it effectively:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Be selective: <\/strong>Only hide validations that frequently interrupt workflows. For example, an Order Date earlier than a Work Date is safe. Keep critical warnings, like missing vendor info, visible.<\/li>\n\n\n\n<li><strong>Test extensively in sandbox: <\/strong>Check single and bulk purchase entries. Include recurring orders and linked workflows, such as inventory updates or ledger posting. This ensures no hidden errors occur.<\/li>\n\n\n\n<li><strong>Document all changes clearly: <\/strong>Note which messages are suppressed and why. Record the AL code used and include examples or screenshots for future reference.<\/li>\n\n\n\n<li><strong>Monitor after deployment:<\/strong> Review user feedback and posting logs for at least one business cycle. Confirm suppressed messages do not mask important issues.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Improve Purchase Entry With Message Control<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Validation messages in Business Central protect data, but frequent warnings can slow purchase document entry. Knowing how to hide messages in purchase documents lets teams reduce interruptions, speed up workflows, and maintain accuracy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At <a href=\"https:\/\/www.aegissofttech.com\" target=\"_blank\" rel=\"noreferrer noopener\">Aegis Softtech<\/a>, we turn complex <a href=\"https:\/\/www.aegissofttech.com\/dynamics-365\/business-central-implementation\">Business Central implementation<\/a> and customization requirements into smooth, reliable processes. Our <a href=\"https:\/\/www.aegissofttech.com\/hire\/dynamics-365-business-central-developers\">Business Central developers<\/a> help organizations remove unnecessary interruptions, optimize purchase workflows, and implement precise AL solutions that work exactly as needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every customization we deliver balances efficiency with accuracy, so you can focus on work, not warnings.<\/p>\n\n\n    \t<section class=\"call-to-action-section\">\n    \t\t<div class=\"call-to-action-container\">\n    \t\t\t<div class=\"call-to-action-body\">\n    \t\t\t\t<div class=\"cta-title\"><\/div>\n    \t\t\t\t<p><\/p>\n<div style='text-align:center; color:white;'>\n<a href='https:\/\/www.aegissofttech.com\/contact-us.html' target='_blank'>Contact us<\/a> to optimize your Business Central experience.<\/div>\n<p><\/p>\n    \t\t\t<\/div>\n    \t\t\t    \t\t<\/div>\n    \t<\/section>\n    \n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is SetHideValidationDialog and how do I use it in Purchase Line?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SetHideValidationDialog is an AL method in Business Central that prevents a specific validation or warning message from appearing when a field is updated. In Purchase Line, you use it inside the OnBeforeValidate trigger for the field you want to control.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you can suppress the Order Date earlier than the Work Date warning by calling Rec.SetHideValidationDialog(true) in the trigger.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Are there risks to suppressing validation messages in purchase documents?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, suppressing messages can hide issues that may lead to incorrect data entry, posting errors, or workflow problems. Only suppress non-critical messages and always test thoroughly in a sandbox environment to avoid unintended consequences.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Which BC versions support HideValidationDialog in purchase workflows?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SetHideValidationDialog is supported in Business Central 2020 release wave 1 and later. It works in both on-premises and cloud environments, but always verify with your version before implementing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Does hiding messages affect audit, compliance, or reporting?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Hiding a message does not remove the underlying validation logic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Data is still checked and stored correctly, so audit trails, compliance, and reporting remain intact. However, suppressing critical warnings could lead to overlooked errors, so use it selectively.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":" ","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[124],"tags":[266],"class_list":["post-1284","post","type-post","status-publish","format-standard","hentry","category-business-central","tag-hide-messages-in-purchase-documents"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/posts\/1284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/comments?post=1284"}],"version-history":[{"count":12,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/posts\/1284\/revisions"}],"predecessor-version":[{"id":19592,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/posts\/1284\/revisions\/19592"}],"wp:attachment":[{"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/media?parent=1284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/categories?post=1284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aegissofttech.com\/insights\/wp-json\/wp\/v2\/tags?post=1284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}