Defaulting Screen/Mask fields in Sage X3

By | June 29, 2023

In Sage X3, every now and then a requirement requires a defaulting screen/mask field with a value upon initialization or start of processing. To achieve this requirement, Sage X3 offers several ways such as scripting in the Action script under specific events or through screen dictionaries.
Below we are demonstrating how to default value through screen dictionary in Sage X3:

We’ll be referencing the following screen from Sage X3 for this:

Product Master: All > Common Data > Product (GESITM)
Window Management: All > Development > Script dictionary > Windows (GESAWI)
Screen Management: All > Development > Script dictionary > Screens (GESAMK)

Refer the screenshots for reference:

-In the below Fig. 1 we can see that the reference product record Description 3 field is initialized as its stored data.

New Stuff: Workflow in Sales Price List

Fig. 1 - Desc. 3 original data
Fig. 1 – Desc. 3 original data

-Now we’re gonna show how to initialize this field as well as the Category field of Header from Screen management. For this navigate over to Windows management as shown below in Fig. 2 then jump onto the respective screens.

Fig. 2 - Screens under OITM window
Fig. 2 – Screens under OITM window

-Under the screens ITM0 & ITM1 we’ll look for the Fields tab and navigate over to the Default value column for our field codes within the grid as shown below in Fig. 3. We are initializing the fields with two ways:
-Normal Defaulting. (Fig. 3)
-Forced Defaulting – By putting an * symbol before the data. (Fig. 4)

Fig. 3 - Passing a default data for the field
Fig. 3 – Passing a default data for the field
Fig. 4 - Setting a default data for forced initialization
Fig. 4 – Setting a default data for forced initialization

-After setting the default values, save the screens and validate them and later perform a Window validation to take in effect. Now reopen the transaction screen for verifying the changes. We’ll notice that the two things:
-FORCED DEFAULTING INITIALIZES DATA EVEN FOR CREATED RECORD as shown in Fig. 5.
-NORMAL DEFAULTING INITIALIZES ONLY FOR ENTERED DATA UPON NEW CREATION as shown in Fig. 6

Fig. 5 - Default value is forced initialized on field
Fig. 5 – Default value is forced initialized on field
Fig. 6 - Both defaults working upon new creation
Fig. 6 – Both defaults working upon new creation

This is how we can default data fields in two different ways using Screen defaulting in Sage X3.