{"id":90,"date":"2011-09-28T13:06:14","date_gmt":"2011-09-28T13:06:14","guid":{"rendered":"http:\/\/greytrix.com\/blogs\/sageaccpacerp\/?p=90"},"modified":"2024-12-13T09:07:14","modified_gmt":"2024-12-13T09:07:14","slug":"how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/","title":{"rendered":"How to control the posting on transaction screens in Accpac ERP through your code"},"content":{"rendered":"<p>Normally if you click on POST button of any transaction screen it will fire all the standard validations of Accpac and if all the validations PASS it will post the transaction, however if any of the validations fail then Accpac will pop up a error message and won\u2019t post the document.<br \/>\nThis is standard behavior, but we often get requirements from end user to add custom validations over and above Accpac\u2019s standard validations, Say for instance; someone may require PO Number as a mandatory field in Order Entry Screen which should be entered by user before posting the document.<br \/>\nAdding validation is not a big deal, where people often get stuck is \u201cHow do I control the Posting routine of Accpac so that if My validation fails Accpac Does not Post the document?\u201d<br \/>\nIt looks like a challenge until you discover the method to do it, but once you know it, it\u2019s as simple as setting a variables value. Just to save your time here is how to do it<br \/>\nOn AccpacOE1100UICtrl1_OnUIAppOpened event first set the data source.<\/p>\n<fieldset>\n<legend>Script<\/legend>\n<p>Private Sub AccpacOE1100UICtrl1_OnUIAppOpened()<br \/>\nSet adsOEORDH = AccpacOE1100UICtrl1.UIDSControls.Item(&#8220;adsOEORDH&#8221;)<br \/>\nEnd sub<\/fieldset>\n<p>Then on data source change event put your verifications.<\/p>\n<fieldset>\n<legend>Script<\/legend>\n<p>Private Sub adsOEORDH_OnRecordChanging(ByVal eReason As AccpacCOMAPI.tagEventReason, pStatus As AccpacCOMAPI.tagEventStatus, ByVal pField As AccpacDataSrc.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrc.IAccpacDSFields)<br \/>\nIf eReason = RSN_Addnew or  eReason = RSN_Update Then<br \/>\nIf (Condtion = true ) Then<br \/>\nPstatus = Status_OK<br \/>\nElse<br \/>\nPstatus = Status_Cancel<br \/>\nEnd if<br \/>\nEnd if<br \/>\nEnd sub<\/fieldset>\n<p><strong>condition<\/strong> could be a variable coming from your validation if it\u2019s true that means your validation passed if it&#8217;s false that means it failed.<br \/>\nAs you can see from the above snippet \u201cPstatus\u201d is a parameter and posting can be controlled through it.  In order to restrict the posting set Pstatus = Status_Cancel and to continue the posting set it to Status_OK.<br \/>\nHope this helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Normally if you click on POST button of any transaction screen it will fire all the standard validations of Accpac and if all the validations PASS it will post the transaction, however if any of the validations fail then Accpac will pop up a error message and won\u2019t post the document. This is standard behavior,\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[1984,2880,2968],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","tag-posting","tag-transaction","tag-validations"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to control the posting on transaction screens in Accpac ERP through your code<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to control the posting on transaction screens in Accpac ERP through your code\" \/>\n<meta property=\"og:description\" content=\"Normally if you click on POST button of any transaction screen it will fire all the standard validations of Accpac and if all the validations PASS it will post the transaction, however if any of the validations fail then Accpac will pop up a error message and won\u2019t post the document. This is standard behavior,\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-28T13:06:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-13T09:07:14+00:00\" \/>\n<meta name=\"author\" content=\"sage300\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sage300\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\",\"name\":\"How to control the posting on transaction screens in Accpac ERP through your code\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"datePublished\":\"2011-09-28T13:06:14+00:00\",\"dateModified\":\"2024-12-13T09:07:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to control the posting on transaction screens in Accpac ERP through your code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\",\"name\":\"Sage 300 ERP \u2013 Tips, Tricks and Components\",\"description\":\"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! \",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\",\"name\":\"sage300\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"caption\":\"sage300\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to control the posting on transaction screens in Accpac ERP through your code","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/","og_locale":"en_US","og_type":"article","og_title":"How to control the posting on transaction screens in Accpac ERP through your code","og_description":"Normally if you click on POST button of any transaction screen it will fire all the standard validations of Accpac and if all the validations PASS it will post the transaction, however if any of the validations fail then Accpac will pop up a error message and won\u2019t post the document. This is standard behavior,\u2026 Read More &raquo;","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2011-09-28T13:06:14+00:00","article_modified_time":"2024-12-13T09:07:14+00:00","author":"sage300","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sage300","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/","name":"How to control the posting on transaction screens in Accpac ERP through your code","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"datePublished":"2011-09-28T13:06:14+00:00","dateModified":"2024-12-13T09:07:14+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5"},"breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/09\/28\/how-to-control-the-posting-on-transaction-screens-in-accpac-erp-through-your-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"How to control the posting on transaction screens in Accpac ERP through your code"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/","name":"Sage 300 ERP \u2013 Tips, Tricks and Components","description":"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5","name":"sage300","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","caption":"sage300"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":35403,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/90\/revisions\/35403"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}