How to default Validity date to certain days from Date of creation for Sales Quote module

By | September 30, 2021

In Sage X3, Users can create Sales Quotes for keeping a track of which customer has placed their quotes for the products. When these quotes are created from the screen then the date of creation is defaulted to current date, there is another field in the Management tab of the screen called Validity date which is to keep track of the particular quote’s validity.
This Validity field is not mandatory so oftentimes users can forget it and it remains empty. But the data stores for such a field is defaulted to 1st Jan 1947 which is of no use for tracking. So in this blog, we’ll be showing a way to get a default value for the Validity field that’ll be referenced after certain days from the date of creation.

First to navigate to the screens that’ll be used for the below steps:

Sales Quote: All > Sales > Quotes > Quotes
Window management: All > Development > Script dictionary > Windows
Script Editor: All > Development > Script dictionary > Script editor

For the purpose of making things clear refer below screenshots:

New Stuff: How to solve warning “Non-blocking difference Warning format PLICRDIDX K10c Sage X3” while importing data through template

[Date of creation & Validity date on Sales Quote screen]
[Date of creation & Validity date on Sales Quote screen]

Now that we’re familiar with the screens, below are the steps for setting up default value for Validity date field:

Step 1: Navigate over to the Sales quote window in the Window management under development using the code OSQH, there you can see all the linked screens for the window.

Step 2: We need to make sure that as soon as the user enters the Site code in the Sales quote screen then the validity date defaults itself. For this we’ll have to set up action events (After field & After change) on the site field in header screen SQH0 and validate the screen. Below are the screenshots showing the same:

[Sales site field on Header screen]
[Sales site field on Header screen]
[After change and After field SPE action events of Sales site field]
[After change and After field SPE action events of Sales site field]

Step 3: Once the validations are done, we need to add the script logic for these action events in the specific script SPESQH. We’re considering the default value to be 30 days from date of creation (QUODAT), below is the logic we’ve used:

[Script part for After field and After change events]
[Script part for After field and After change events]

Here the validity field exists on the Management tab screen (SQH1) as VLYDAT. Once the script is written, compile the part to check if any error is there.

Step 4: After the successful compilation, in a new Sage X3 tab open the Sales quote module and test whether the default value is setting after site code.

In this way, we can set a default date for the Validity date field corresponding to the date of creation.

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, 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 caters to a wide range of Sage X3, a Sage Business Cloud Solution, offerings. Our unique GUMU™ integrations include Sage X3 for Sage, Dynamics 365 CRM and Magento eCommerce along with Implementation and Technical Support worldwide for Sage X3. Currently we are Sage X3 Implementation Partner in East Africa, Middle East, Australia, Asia, US, UK. We also offer best-in-class Sage X3 customization and development services, integrated applications such as POS | WMS | Payment Gateway | Shipping System | Business Intelligence | eCommerce and have developed add-ons such as Catch – Weight  and Letter of Credit and India Legislation for Sage X3 to Sage business partners, end users and Sage PSG worldwide. Greytrix Sales Commission App for Sage X3 simplifies commission calculations and postings on sales transactions.

The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for processing and execution of application programs at the click of a button.

Greytrix is a recognized Sage champion ISV Partner for GUMU™ Sage X3 – Sage CRM integration also listed on Sage Marketplace; GUMU™ integration for Sage X3 – Salesforce is a 5-star rated app listed on Salesforce AppExchange and GUMU™ integration for Dynamics 365 CRM – Sage ERP listed on Microsoft AppSource.

For more information on Sage X3 Integration and Services, please contact us at, We would like to hear from you.