Showing messages from Scheduled Job

Arun Kumar P1
Kilo Contributor

Hello,

Is it possible to show an error message to the form from a Scheduled Job? I tried gs.addErrorMessage('error_message_here') but it's not displaying in the form.

Thank you.

1 ACCEPTED SOLUTION

DirkRedeker
Mega Sage

Hi

scheduled jobs are not running interactive but in the background.

There is NO screen context to the UI. So, using addInforMessage() will never show up from within scheduled jobs.

one thing, you can do is, to log some messages in the system log, or create a custom table and update records there. Then you can show these records on the users side, by list, form or even dashboards and reports.

that way, you hand over the “status” of a scheduled job the the admin user or any other user, who need keep track on the progress of scheduled jobs..

 

let me know, if that solved your issue, and mark my answer as correct and helpful, please.

BR

Dirk

View solution in original post

7 REPLIES 7

AbhishekGardade
Giga Sage

you can add it but it wont work.

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Harsh Vardhan
Giga Patron

you can't show the message on form because schedule job do not run for specific form . 

that does not make any sense to add message on scheduled job script. if you have any specific value that you wanna know then add it inside the log. 

gs.log()

 

if you wanna add the message then use it on business rule or ui action server or client side block script. 

DirkRedeker
Mega Sage

Hi

scheduled jobs are not running interactive but in the background.

There is NO screen context to the UI. So, using addInforMessage() will never show up from within scheduled jobs.

one thing, you can do is, to log some messages in the system log, or create a custom table and update records there. Then you can show these records on the users side, by list, form or even dashboards and reports.

that way, you hand over the “status” of a scheduled job the the admin user or any other user, who need keep track on the progress of scheduled jobs..

 

let me know, if that solved your issue, and mark my answer as correct and helpful, please.

BR

Dirk

Nitesh Upare1
Kilo Contributor

Instead of writing gs.addInfoMessage() you can write gs.log('error message') so that you can track the errors. you can also use gs.error() or gs.warn() to set the log level. you can find these logs in system logs (syslogs_list) form.

 

Regards,

Nitesh