How to send a log trace file via email using the standard process

By | December 15, 2023

Step 1 : Start the Batch server

  • In Sage X3, Batch server is a component of the software that is responsible for executing batch processes. Batch processes are typically large-scale, repetitive tasks that need to be performed in the background, such as data imports, report generation, data updates, and other automated operations.
  • Path : All -> Administration -> Endpoints -> Batch server.
Fig 1 : Batch server
  • Click the “Start” option by clicking on the three-dot “Action” button.

Step 2 : Create a Task code in task management.

  • Path : All -> Usage -> Batch server -> Task management.
  • Task management within Sage X3 typically refers to the process of organizing, tracking, and managing various tasks.

NOTE : Choose “Task” for processing in functions or select “Script” as the task type for subprograms.

Fig 2 : Task management

Fig 2 : Task management

  1. Make a new task code.
  2. Choose “Processing” as the task type.
  3. Specify the function you want to call in the ‘Function’ field for this task code.
  4. Tick the ‘Message – User’ box.

Step 3 : Creating a workflow.

  • Path : All -> Setup -> Workflow -> Workflow rules.
  1. Duplicate the ‘ENDREQ’ Standard workflow.
  2. Set the event type to ‘End of task.’
  3. In the event code field, enter the task code you are using for log traces, like ‘YFUNSTOR’ for Stock resynchronization and control as an example.
Fig 3.2 : Workflow_management_checkbox
  • On the General tab, mark the ‘Trigger Email’ box, which will send an email to the specified recipient ID.
  • If necessary, enable the ‘Debug mode’ checkbox for log traces/log files after processing.
  1. Enter the recipient’s ID in the Recipient field within the Recipient tab and proceed with the following steps.If required enter conditions or else put it blank.
  2. Ensure that the “Send email” option is set to ‘YES.’
  3. Set the milestone to ‘NO.’
  4. Select the “Delegate option” as ‘NO.’
Fig 3.4 : Workflow Attachments
  • Tick the ‘Linked trace file’ checkbox in the Message tab.

Step 4 : Query submission.

  • Path : All -> Usage -> Batch server -> Query submission.
Fig 4.1 : Query submission
  1. In the Query submission section, provide the task code you wish to call.
  2. Click the validation button located in the top-right corner.
  3. Upon clicking the Validation button, a screen will open, showing the linked function.
  4. Input the necessary data, click the ‘OK’ button, and a query will be created and displayed in the message box.
Fig 4.2 : Stock resynchronization and control (FUNSTOR)

Note: You can verify the query in Query management.

Fig 4.3 : Query submission

Step 4 : Query management.

  • Path : All -> Usage -> Batch server -> Query management.
  1. You can observe that following the Query submission, there is a function listed in the Task code column. The status of the query can be found in the Status column, with ‘Standby’ indicating it’s processing and ‘Finished’ indicating that the query has been executed.
  2. To view the most recent query, click the Update button located in the top-right corner.
  3. In the Task code section, you’ll find the task code you created during the ‘query submission’ process.
  4. Under the Status column, you can verify the status of the query.
  5. The Task type column displays whether the query is function-based or script-based.
  6. To access the log file, click the three-dot “Action” button and select “Log.” This will display the log file for the process.
  7. Once the status changes to “Finished,” the recipient will receive an email containing the log trace file.
Fig 4.5 : Query management

In this way we can send a log trace file via email using the standard process.