Automate the log checking of scheduled jobs in Sage X3 and be calm!

Who manage Sage X3 ERP software doesn’t alert you for scheduled job error of MRP execution?

Are you the Sage admin and you don’t have time to check all the logs day by day?

Good, keep reading, we are going to solve your problem in a blink of an eye:
we will see how to check logs of the Sage X3 scheduled jobs
without to have to check them one by one
and in the same time we don’t lost any error on the way.

I assure you that automate check logs of scheduled job it will make you more peaceful!

Happy users and happy admins too!

We will see then:

All this without parametrization, that is without any coding.

How to view a log file of a scheduled job in Sage X3

You can find logs of the various scheduled jobs under the menu item
Usage\BATCH SERVER\Query management” (AREQUETE function):

Query Management menu item in Sage x3
Query Management menu item – Sage X3



Here you can see if there are any processes that have errors:

Query Management (AREQUETE): 
example of error - Sage X3
Process with error – Sage X3

Click on the left row menu, click then the “Log” item of the context menu to view the file log of your process.

Query management: log view - Sage X3
How to view the log of a process

If there are any errore in the log, on the right the follow items will be active:

  • Next error” to directly jump from an error row to another, very useful if the file is very long
  • Errors” to display only errors

If you need it you can get a copy of log by the “Copy” menu item.

All this is very useful, but generally there are many processes,
so this work takes a long time.

It’s much more comfortable to send an email in case of errors to people interested in that process.
We have already seen 3 ways to send a mail from code in Sage X3, with more attachments too but they aren’t suitable in this situation.

You can find other information for the mail sending in the SageDev knowledge base,
where you can freely write your notes (in English too, also if at the moment all notes are in Italian),
so as to build together a collection of useful tips and tricks.

But that info too are not useful in our situation.

Then let’s see how to send by mail the log trace of jobs scheduled in the Sage X3 system.

Hey, wait a moment before continuing!
Make sure you too get my legendary Sage X3 newsletter!
Join the club, sign up now!

Have you done? Great!
And if you want contact me in LinkedIn
!

How to send trace log of a Sage X3 job with errors by mail

Let’s suppose that the job code that we want check will be FUNSTOR
(how you can see in a previous image FUNSTOR was a raw in red color job, then a job with errors).

Let’s go to menu item Setup\Workflow\Workflow rules (GESAWA function).
You can access here only with developer permission.

Seek the rule with ENDREQ code (End of Task):

End of Task  Workflow rules - Sage X3
ENDREQ Workflow rule – Sage X3

Substitute ENDREQ with, for example, YENDREQ, change description, and in the Event code field write FUNSTOR:

If this message appears:

it means that you need activate the “Messagge – User” flag of the job: you can do it at menu item “Usage\BATCH SERVER\Task managements” (GESABT function):

To ensure that only log with errors will be sent you have to add an header condition:

[F:ABR]FLAG=6 or [F:ABR]FLAG=7 or [F:ABR]FLAG=8

In the Recipient Tab insert people who will receive tha mail with log error.
You can insert the email address or the code of user; as Type select “User”, and obviously set “Yes” in the “Send mail” column:

At this point just activate the workflow rule (“Active” flag in the top right), click on “Create” an then on “Validation“:

If you want change the condition under which the mail has to be sent see chapter 21 of “Local Menus”, at menu item “Development\Data and parameters\Tables\Local menu – messages” (TXT function):

Done!

So, at each run of the FUNSTOR process,
in case of errors,
an email will be sent with the log trace attached.
I haven’t say that before because ENDREQ rule is already configured in this way,
but to have the log file attached in the mail you must set the “Linked trace file” flag in the “Message” tab, “Attachments” section:

Linked file - Message Tab, workflow rule - Sage X3

Easier to do than to explain.

This configuration is very recommended:
just give a single example and then multiply it for each scheduled process.

Let’s take for example the MRP process:
it’s a great benefit that plannig manager receives the email with the log trace of MRP process.
The planning office has immediately on control any problem that can rise from MRP,
maybe caused by a wrong items parametrization made the day before,
and then still fresh in mind and rapidly resolvable.
Who manages Sage EM save a lot of time and makes sure many less calls by collegues, less troubleshooting and a well oiled system!

Lets’me know!

And be careful not lost the next interesting post:
subscribe to the newsletter!

You may also like...

Leave a Reply