Our Blog

How to add a question box to a field on a screen.

Have you ever noticed that on some of the screens in X3, there is a question box that pops up before a user closes a purchase order, for example, and based on their answer to the question, certain functions can happen, or not.
Have you ever thought that you would like to add this functionality to other screens in Sage X3? Well, now you can.

The below would be for a user with a basic knowledge of Sage development functionality.
All that is required is a small piece of code to be entered, the action you want to happen based on the answer to your question, and you are good to go.
The syntax is very simple for the question box itself, the syntax is as follows.
Qstbox "[Enter your question here]" Using [L] REP, where REP is a local Libelle.
An example of a simple question box would be as follows, we are just wanting to get a yes or no reply message to pop up with our question "Do you want to proceed?".
So, in order to get our desired result, we would write the following.
In the field (After change, After field etc), or button action, we would add our small piece of code.

Local Libelle REP
Qstbox "Do you want to proceed?" Using [L] REP
Case [L] REP
    When 1 : Infbox "Yes"
    When 2 : Infbox "No"

NB, the Infbox section above is being used to display the results of the question ONLY, and would be replaced with your action code. 
You could have your code populate another field on the screen, 'lock' the user in a field, if the value fails a check or grey out other fields. 
The options are varied and numerous.
The below screenshots will illustrate the results, when we run the above example piece of code.
The question box

After we have clicked on the 'Yes' button in answer to the question.

For more information on Sage X3 integration and services, please contact us on 08 8366 6511 or on ebsolsupport@ebsol.com.au.
We will be glad to assist you.
Tags: , , , ,

This is a unique website which will require a more modern browser to work! Please upgrade today!