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 by customizing the Sales Order screen (OSOH) and controlling the visibility and access to Work Order creation options in Sage X3.
Work Order Generation in Sales Order Screen:
There are two ways to generate a Work Order from the Sales Order screen:
- At the line level via the 3-dot menu — Multilevel Planning
New Stuff: HSBC Integration with Sage X3

On the right panel of the Sales Order screen via the 3-dot menu — Work Order

Implementation Steps
- Hide ‘Multilevel Planning’ Option at Line Level
To achieve this, we used the Init Button action on the NBLIG field within the SOH4 screen of the Sales Order window.
Steps:
- Go to: Development → Script Dictionary → Windows → OSOH
- Open the SOH4 screen.
- Click on the field NBLIG.
- Add the Init Button action.
- Save and validate the screen.
- Globally validate the OSOH window and the Sales Order transactions from setup module.

Code:
Add the code below script to hide the Multilevel Planning option when the condition is met:
If Product source = 5 AND (Signed flag <> 3 OR Signed flag <> 5)
Raz GBOUT15
##Here the GBOUT15 is the button code for multi-level planning option
else
ENDIF
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.
- Disable ‘Work Order’ Option at Header Level
To control the Work Order menu on the right-hand panel, we added following script
Code:
If Product source = 5 AND (Signed flag <> 3 OR Signed flag <> 5)
##Stop the standard process then use the below code
Call VIREBOUT(CHMEN,”DM”) From GOBJET
else
ENDIF
This disables the Work Order option if the condition is met for any line in the Sales Order.
Final Result
With these changes:
• The Multilevel Planning option is hidden at the line level until the Sales Order is approved.
• The Work Order option on the header is disabled until the Sales Order is approved.

These conditions ensure that Work Orders are only generated post-approval, maintaining process control and data integrity.
Summary Table
Feature | Location | Action Used | Script / Field | Condition Applied |
Multilevel Planning Button | Line level (3-dot) | Init Button | SPESOH script/NBLIG in SOH4 screen | Product Source = 5 AND SO not approved |
Work Order Menu | Header (3-dot) | SETBOUT | SPESOH script | Product Source = 5 AND SO not approved |
About Us
Greytrix – 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.
Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3, Sage Intacct, Sage 100, Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like Greytrix Business Manager, Sage CRM Project Manager, Sage CRM Resource Planner, Sage CRM Contract Manager, Sage CRM Event Manager, Sage CRM Budget Planner, Gmail Integration, Sage CRM Mobile Service Signature, Sage CRM CTI Framework.
Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework 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.
For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.