{"id":31110,"date":"2025-08-29T07:06:36","date_gmt":"2025-08-29T07:06:36","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagex3\/?p=31110"},"modified":"2025-08-29T07:06:36","modified_gmt":"2025-08-29T07:06:36","slug":"disabling-work-order-options-until-sales-order-approval-in-sage-x3","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/08\/29\/disabling-work-order-options-until-sales-order-approval-in-sage-x3\/","title":{"rendered":"Disabling Work Order Options Until Sales Order Approval in Sage X3"},"content":{"rendered":"\n<p>A client recently had a requirement related to restricting Work Order creation in Sales Orders under certain conditions. Specifically:<\/p>\n\n\n\n<p>When the Product Source type is Work Order on a Sales Order line, the Work Order generation options should not be available until the Sales Order is fully approved.<\/p>\n\n\n\n<p>This blog explains how we achieved this by customizing the Sales Order screen (OSOH) and controlling the visibility and access to Work Order creation options in <a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\" rel=\"noreferrer noopener\">Sage X3<\/a>.<\/p>\n\n\n\n<p><strong>Work Order Generation in Sales Order Screen<\/strong>:<\/p>\n\n\n\n<p>There are two ways to generate a Work Order from the Sales Order screen:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>At the line level via the 3-dot menu \u2014 Multilevel Planning<\/strong><\/li>\n<\/ol>\n\n\n\n<p><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/08\/29\/hsbc-integration-with-sage-x3\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/08\/29\/hsbc-integration-with-sage-x3\/\" rel=\"noreferrer noopener\">HSBC Integration with Sage X3<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/08\/fig1-multilevel-planning.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\/2025\/08\/fig1-multilevel-planning.png\" alt=\"fig1 multilevel planning\"><\/a><\/center>\n<font size=\"2\"><center>fig1 multilevel planning<\/center><\/font>\n\n\n\n<p>On the right panel of the Sales Order screen via the 3-dot menu \u2014 Work Order<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/08\/fig2-work-order-menu.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\/2025\/08\/fig2-work-order-menu.png\" alt=\"fig2 work order menu\"><\/a><\/center>\n<font size=\"2\"><center>fig2 work order menu<\/center><\/font>\n\n\n\n<p><strong>Implementation Steps<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Hide &#8216;Multilevel Planning&#8217; Option at Line Level<br>To achieve this, we used the Init Button action on the NBLIG field within the SOH4 screen of the Sales Order window.<\/li>\n<\/ol>\n\n\n\n<p><strong>Steps:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to: Development \u2192 Script Dictionary \u2192 Windows \u2192 OSOH<\/li>\n\n\n\n<li>Open the SOH4 screen.<\/li>\n\n\n\n<li>Click on the field NBLIG.<\/li>\n\n\n\n<li>Add the Init Button action.<\/li>\n\n\n\n<li>Save and validate the screen.<\/li>\n\n\n\n<li>Globally validate the OSOH window and the Sales Order transactions from setup module.<\/li>\n<\/ol>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/08\/fig3-SOH4-screen.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\/2025\/08\/fig3-SOH4-screen.png\" alt=\"fig3 SOH4 screen\"><\/a><\/center>\n<font size=\"2\"><center>fig3 SOH4 screen<\/center><\/font>\n\n\n\n<p><strong>Code:<\/strong><br>Add the code below script to hide the Multilevel Planning option when the condition is met:<br>If Product source = 5 AND (Signed flag &lt;> 3 OR Signed flag &lt;> 5)<br>Raz GBOUT15<br>##Here the GBOUT15 is the button code for multi-level planning option<br>else<br>ENDIF<\/p>\n\n\n\n<p>This hides the Multilevel Planning option from the line-level 3-dot menu if the product source is Work Order and the Sales Order is not fully approved.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li><strong>Disable &#8216;Work Order&#8217; Option at Header Level<\/strong><\/li>\n<\/ol>\n\n\n\n<p>To control the Work Order menu on the right-hand panel, we added following script<\/p>\n\n\n\n<p><strong>Code:<\/strong><br>If Product source = 5 AND (Signed flag &lt;> 3 OR Signed flag &lt;> 5)<br>##Stop the standard process then use the below code<br>Call VIREBOUT(CHMEN,&#8221;DM&#8221;) From GOBJET<br>else<br>ENDIF<\/p>\n\n\n\n<p>This disables the Work Order option if the condition is met for any line in the Sales Order.<\/p>\n\n\n\n<p><strong>Final Result<\/strong><br>With these changes:<\/p>\n\n\n\n<p>\u2022 The Multilevel Planning option is hidden at the line level until the Sales Order is approved.<br>\u2022 The Work Order option on the header is disabled until the Sales Order is approved.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2025\/08\/fig4-Output-1024x413.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\/2025\/08\/fig4-Output-1024x413.png\" alt=\"fig4 Output\"><\/a><\/center>\n<font size=\"2\"><center>fig4 Output<\/center><\/font>\n\n\n\n<p>These conditions ensure that Work Orders are only generated post-approval, maintaining process control and data integrity.<\/p>\n\n\n\n<p><strong>Summary Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Feature<\/strong><\/td><td><strong>Location<\/strong><\/td><td><strong>Action Used<\/strong><\/td><td><strong>Script \/ Field<\/strong><\/td><td><strong>Condition Applied<\/strong><\/td><\/tr><tr><td>Multilevel Planning Button<\/td><td>Line level (3-dot)<\/td><td>Init Button<\/td><td>SPESOH script\/NBLIG in SOH4 screen<\/td><td>Product Source = 5 AND SO not approved<\/td><\/tr><tr><td>Work Order Menu<\/td><td>Header (3-dot)<\/td><td>SETBOUT <\/td><td>SPESOH script<\/td><td>Product Source = 5 AND SO not approved<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n[about_us_blog_common]\n","protected":false},"excerpt":{"rendered":"<p>A client recently had a requirement related to restricting Work Order creation in Sales Orders under certain conditions. Specifically: When the Product Source type is Work Order on a Sales Order line, the Work Order generation options should not be available until the Sales Order is fully approved. This blog explains how we achieved this\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2025\/08\/29\/disabling-work-order-options-until-sales-order-approval-in-sage-x3\/\">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":[603,4407,4402,1822,2428],"class_list":["post-31110","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","category-integration","tag-disable-button","tag-disable-menu","tag-field-options","tag-sage-x3","tag-work-order"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31110","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=31110"}],"version-history":[{"count":8,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31110\/revisions"}],"predecessor-version":[{"id":31118,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/31110\/revisions\/31118"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=31110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=31110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=31110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}