{"id":21404,"date":"2020-12-29T04:07:04","date_gmt":"2020-12-29T04:07:04","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=21404"},"modified":"2020-12-29T04:09:25","modified_gmt":"2020-12-29T04:09:25","slug":"how-to-close-po-programmatically-using-4gl-script","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/12\/29\/how-to-close-po-programmatically-using-4gl-script\/","title":{"rendered":"How to \u2018Close PO\u2019 programmatically using 4GL Script"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\" rel=\"noreferrer noopener\">Sage X3<\/a>, User have option to close Purchase order manually by using \u201cclose order\u201d button on Purchase order screen. But one of our client has requested to automate this process on certain event so that user doesn\u2019t have to take of this manually. To achieve this we have come up with some customization on PO screen where we did the 4GL code. Using the standard subprogram from standard script, we able to do it successfully. Lets look at the subprogram code.<\/p>\n\n\n\n<p><strong>New stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/12\/28\/restriction-on-purchase-invoice-creation\/\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/12\/28\/restriction-on-purchase-invoice-creation\/\" target=\"_blank\" rel=\"noreferrer noopener\">Restriction on Purchase Invoice Creation<\/a><\/p>\n\n\n\n<p><strong>Syntax:<\/strong><\/p>\n\n\n\n<p>Call TRTPOHCLE (WPOHNUM, WMSGFLG, WRET) From TRTACHDIV1<\/p>\n\n\n\n<p>Here is the meaning of each parameter value,<\/p>\n\n\n\n<p><strong>WPOHNUM:<\/strong> Purchase order number<br><strong>WMSGFLG:<\/strong> It is Integer value which indicates error message<br><strong>0:<\/strong> No error Message<br><strong>1:<\/strong> error on screen (Call ERROR)<br><strong>2:<\/strong> GMESSAGE+GERROR<br><strong>3:<\/strong> Message in trace<br><strong>WRET:<\/strong> (Return Code) It Contains an integer value.<\/p>\n\n\n\n<p>By calling above subprogram we can close the Purchase order.<\/p>\n\n\n\n<p>Through above syntax we can close the purchase order by calling TRTPOHCLE subprogram from standard script with proper parameters.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>Here we have created one Purchase order as shown in below screenshot which is showing closed order status \u201cNo\u201d means PO is not closed yet.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Purchase-Order-screen-Closed-Status-No-1024x571.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Purchase-Order-screen-Closed-Status-No-1024x571.png\" alt=\"Purchase Order screen- Closed Status \" no\"\"=\"\"><\/a><\/center>\n<font size=\"2\"><center>Purchase Order screen- Closed Status &#8220;No&#8221;<\/center><\/font>\n\n\n\n<p>Now, call the Subprogram with appropriate parameter as mentioned in below script screenshot to close PO.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Script.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Script.png\" alt=\"Script\"><\/a><\/center>\n<font size=\"2\"><center>Script<\/center><\/font>\n\n\n\n<p>After execution of script, Purchase order got closed as shown in below screenshot.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Purchase-Order-screen-Closed-Status-Yes-1024x570.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2020\/12\/Purchase-Order-screen-Closed-Status-Yes-1024x570.png\" alt=\"Purchase Order screen- Closed Status \" yes\"\"=\"\"><\/a><\/center>\n<font size=\"2\"><center>Purchase Order screen- Closed Status &#8220;Yes&#8221;<\/center><\/font>\n\n\n\n<p>In this way, any programmer who knows the 4GL scripting can do this customization easily.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>About Us<\/strong><\/h2>\n\n\n\n<p>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 id=\"block-28013e99-0882-44c6-b705-7b16c85053b2\">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 id=\"block-4bc42a09-fb13-4598-8137-ce5f7b91ce28\">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=\"noreferrer 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=\"noreferrer noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"noreferrer 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 id=\"block-76376301-1c3e-4250-8a09-727595a606f0\">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 Sage X3, User have option to close Purchase order manually by using \u201cclose order\u201d button on Purchase order screen. But one of our client has requested to automate this process on certain event so that user doesn\u2019t have to take of this manually. To achieve this we have come up with some customization on\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/12\/29\/how-to-close-po-programmatically-using-4gl-script\/\">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":[13,8,2796],"tags":[20,3174,3175,1565,2157],"class_list":["post-21404","post","type-post","status-publish","format-standard","hentry","category-integration","category-sage-erp-x3","category-technical","tag-4gl","tag-closed-po","tag-programmatically","tag-purchase-order","tag-status"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21404","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=21404"}],"version-history":[{"count":7,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21404\/revisions"}],"predecessor-version":[{"id":21477,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21404\/revisions\/21477"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=21404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=21404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=21404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}