Refreshing the Left-List data for misc. windows using 4GL scripting in Sage X3

By | October 28, 2022

In Sage X3, one of the client’s requirements was to get a left-list browser on a custom miscellaneous type window from where we were creating transactions in an unique way.
Since we know for left-lists an object needs to be linked in the browser tab of the window under development window, and the object requires a linked data table. However a miscellaneous type window doesn’t flow the standard screen actions that of an object type window so all the standard object actions for refreshing the left-list’s data don’t work automatically here.

New Stuff: Reorder Plan function

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

Script Editor: All > Development > Script Dictionary > Scripts > Script Editor (ADOTRT)

Refer the screenshots for reference:

Note: Below process is shown for an miscellaneous type window, for an object type window this is being automatically handled by Sage standard scripts.

Step 1: Make sure that the linked table in the browser object is open within the screen. If not, then you’ll have to open the table/file first using the following snippet under the given Action event.

Code snippet for Opening file (table)
Code snippet for Opening file (table)

Syntax: If !Clalev( [F:{Table abbreviation}] ) : Local File {Table name} [ {Table abbreviation} ] : Endif

Step 2: Next when the required table has been opened, we need to declare the below two label Action events. Refer the below code snippet for the reference:

Code snippet for Refreshing the Left-list browser
Code snippet for Refreshing the Left-list browser

Here change the following things as per requirement:
[ZMVK] = Object linked table abbreviation
[ZSTKM] = Mask/screen abbreviation
ZMVK0 = Table index

Step 3: Calling the $REMPBOX label from anywhere within the code will result in refreshing the left-list browser.

After following all the above steps, we’ll be able to get our left-list browser refreshing done whenever using 4GL scripting.