How to open a screen at query submission of batch task

By | September 29, 2021

In Sage X3, for processing certain functionalities or scripts as per requirement and on interval basis, sage x3 provides a feature of batch task. It allows the user to execute multiple processes at single time and can be processed on interval basis. Creating a batch task is very common. We often create a batch task to automate any processes in Sage X3.

Sage X3 allows adding function code in batch task for execution of those screens based on their function code. Sometimes there might be a requirement where we need to pass parameters using pop screen after query submission of task code. It can be achieved using below steps.

Consider a test screen which is custom action based screen consisting of few fields as shown in below figure.

At first, we need to create a batch task. For that Navigate to: All -> Usage -> Batch Server -> Task Management

In order to open a screen after batch task execution, we need to add the “Function” of the screen and create the “Task code” as shown in below figure.

After entering “Function”, we might get an error saying that “Action not generated in this function” as shown below and will not allow to create the task code.

We can resolve this error by changing settings in “Action” of that function we need to add in the batch task.

Navigate to All -> Development -> Script Dictionary -> Actions -> Click on Actions and open the action code

In General tab, change the ‘Template’ field value to ‘Standard processing’ and change the ‘First Entry’ value to ‘Window entry’. Also we need to add Window code of your screen in ‘Criteria Window’ instead of ‘Main Window’. Along with these changes, make sure that the ‘Batch’ and ‘Public’ checkboxes are checked as shown in below figure.

Now, if we try to create the batch task again we will be able to create it successfully without errors.

To execute this Batch Task, navigate to All -> Usage -> Batch server -> Query Submission

Fill in the all the values in the screen as shown below along with the ‘Task Code’ of the batch task you created and click on ‘Validation’.

Now we can see that the required screen is opened through the Batch Task.

This blog helps in opening a screen on query submission of batch task.