{"id":27,"date":"2011-07-14T07:59:00","date_gmt":"2011-07-14T07:59:00","guid":{"rendered":"http:\/\/greytrix.com\/Blogs\/sageaccpacerp\/?p=27"},"modified":"2024-02-16T12:43:28","modified_gmt":"2024-02-16T12:43:28","slug":"macro-recorded-to-printing-picking-slips-prints-blank-report","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/","title":{"rendered":"Macro recorded to printing Picking Slips prints blank report"},"content":{"rendered":"<div style=\"text-align: left;\">Recently while working on OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report. On further investigation I figured out that problem is due to Parameter &#8220;SESHNDL\u201d (below is the code of recorded Macro)<\/div>\n<div style=\"text-align: left;\"><\/div>\n<div style=\"text-align: left;\"><em>[SNIP]<br \/>\n<\/em><em>Dim rpt As AccpacCOMAPI.AccpacReport<br \/>\n<\/em><em>Set rpt = ReportSelect(&#8220;OEPICK01[OEPICKSHIPMENT1.RPT]&#8221;, &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;, &#8221;\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;)<br \/>\n<\/em><em>Dim rptPrintSetup As AccpacCOMAPI.AccpacPrintSetup<br \/>\n<\/em><em>rpt.SetParam &#8220;SELECTBY&#8221;, &#8220;1&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;SORTBY&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;FROMSELECT&#8221;, &#8220;&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;TOSELECT&#8221;, &#8220;&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;FROMLOC&#8221;, &#8221; ZZZZZZZZZZZZ&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;TOLOC&#8221;, &#8220;ZZZZZZ&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;PRINTBY&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;SERIALLOTNUMBERS&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;PRINTKIT&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;PRINTBOM&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;REPRINT&#8221;, &#8220;1&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;QTYDEC&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;COMPLETED&#8221;, &#8220;0&#8221;<br \/>\n<\/em><em>rpt.SetParam &#8220;SESHNDL&#8221;, &#8220;538988&#8221;<br \/>\n<\/em><em>rpt.NumOfCopies = 1<br \/>\n<\/em><em>rpt.Destination = PD_PREVIEW<br \/>\n<\/em><em>rpt.PrintDir = &#8220;&#8221;<br \/>\n<\/em><em>rpt.PrintReport<br \/>\n<\/em><em>[\\Snip]<\/em><br \/>\nThe parameter \u201cSESHNDL\u201d is auto generated using the OEFLAG (Flag printed records) view (View ID &#8211; OE0270). So when we print the picking slip report at runtime new number for \u201cSESHNDL\u201d (Print Picking Slips Session Hand) is generated and stored in the OEFLAG view; all this is temporary and on completion of printing the report data from this view is cleared.<\/div>\n<div>\n<div>So for our Macro to execute properly we must be able to generate the accurate Picking Slips Session number and pass it to our macro every time it wants to print a Picking Slip.<\/div>\n<div>For this we must INIT and Process the OEFLAG view by passing certain parameter as shown in below Snippet.<\/div>\n<\/div>\n<div>[Snip]<br \/>\nPublic vw_OEFLAG\u00a0\u00a0 As AccpacCOMAPI.AccpacView<br \/>\nmDBLinkCmpRW.OpenView &#8220;OE0270&#8221;, vw_OEFLAG<br \/>\n<em>With vw_OEFLAG<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Init<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;OPTYPE&#8221;).PutWithoutVerification (15) &#8216;If Header Location selected<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;FROMSHI&#8221;).PutWithoutVerification (str_ShipFrom) &#8216;From Location<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;TOSHI&#8221;).PutWithoutVerification (str_ShipTo) &#8216;To Location<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;FROMLOC&#8221;).PutWithoutVerification (str_Loc) &#8216;From Location<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;TOLOC&#8221;).PutWithoutVerification (str_Loc)\u00a0\u00a0 &#8216;To Location<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;LBLREQUIRE&#8221;).PutWithoutVerification (0)<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 .Fields(&#8220;REPRINT&#8221;).PutWithoutVerification (1)<\/em><em><br \/>\n.Process<br \/>\n<\/em><em>\u00a0 \u00a0 \u00a0 \u00a0 str_Sch = .Fields(&#8220;SESHNDL&#8221;).Value<br \/>\n<\/em><em>\u00a0 \u00a0 End With<br \/>\n<\/em><em>[\\Snip]<\/em><\/div>\n<div>So the newly auto generated printed Print Picking Slips Session Hand number is now captured in variable \u201cstr_Sch\u201d which can be passed to our report parameter \u201cSESHNDL\u201d and our problem should be solved.<\/div>\n<div>\n<div><\/div>\n<div>Happy Coding <span class=\"Apple-style-span\" style=\"font-family: Wingdings; font-size: 17px; line-height: 19px;\">J<\/span><\/div>\n<\/div>\n<p><strong>If you find this content useful, please drop us an email at <a title=\"mailto:accpac@greytrix.com\" href=\"mailto:accpac@greytrix.com\">accpac@greytrix.com<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently while working on OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report. On further investigation I figured out that problem is due to Parameter &#8220;SESHNDL\u201d (below is the code of recorded Macro) [SNIP] Dim rpt As\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\">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":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-sage-accpac"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Macro recorded to printing Picking Slips prints blank report<\/title>\n<meta name=\"description\" content=\"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.\" \/>\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\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Macro recorded to printing Picking Slips prints blank report\" \/>\n<meta property=\"og:description\" content=\"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2011-07-14T07:59:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-16T12:43:28+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\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\",\"name\":\"Macro recorded to printing Picking Slips prints blank report\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"datePublished\":\"2011-07-14T07:59:00+00:00\",\"dateModified\":\"2024-02-16T12:43:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\"},\"description\":\"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Macro recorded to printing Picking Slips prints blank report\"}]},{\"@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":"Macro recorded to printing Picking Slips prints blank report","description":"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.","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\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/","og_locale":"en_US","og_type":"article","og_title":"Macro recorded to printing Picking Slips prints blank report","og_description":"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2011-07-14T07:59:00+00:00","article_modified_time":"2024-02-16T12:43:28+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\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/","name":"Macro recorded to printing Picking Slips prints blank report","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"datePublished":"2011-07-14T07:59:00+00:00","dateModified":"2024-02-16T12:43:28+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5"},"description":"OE Picking slip\u2019s customization for a client we recorded a macro for Print Picking Slips routine, but when executed, the macro would just print a blank report.","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2011\/07\/14\/macro-recorded-to-printing-picking-slips-prints-blank-report\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"Macro recorded to printing Picking Slips prints blank report"}]},{"@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\/27","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=27"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":33658,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/27\/revisions\/33658"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}