Show Map/Reduce script error on a SuiteLet - netsuite

I have created a Suitelet which runs a Map Reduce script when user Submits it.
I am able to show messages such as Completed, Failed or In Progress using task.checkStatus(taskId).
Is there anyway that I can also show the MR erros in UI, in case that M/R fails?
Probably I could use Custom Records to create the errors and then show them (too havy) or send the errors via email. But if there is a way I would prefer showing them directly to the user.
Any ideas, suggestions?
Thanks.

A couple of ways to do this:
Log the errors normally.
Periodically while the m/r is running run a search on the script logs filtering the results on the script and deployment.
Accumulate the errors and create a summarize phase in the m/r and email the results to the person who ran the m/r. Netsuiteā€™s example m/r has a hint about how to do that

Related

How to get the ID of user that has started the process in Activiti from a script Groovy?

In a Groovy Script step, I do need to get the user ID that has started the process. As this script is the first step in workflow, maybe getting the "current logged user" could do the work. But in both cases I didn't manage to get it working.
I'm using Activiti 5.22.
Documentation brings that should have this variable "authenticatedUserId" that should have this data, but if I try to use it in the script, it breaks because it has no definition.

Email if a cron job succeeds on Cronitor

Is it possible to add a setting on Cronitor that sends an email once a cron job succeeds. Right now I only get email if a cron job fails.
This is what i have at the moment :
Alert preferences Failure tolerance Duration alerts
Alert notes
(X) Send alerts any time there is a problem
() Only send alerts if my job has consistently not run when expected...
I tried to email/contact support but now answer from Cronitor yet.
I'm one of the creators of Cronitor. I'm really sorry we somehow missed your support inquiry.
The answer is that, yes, this is possible but you cannot set this up without an API call. After the initial setup is complete (and the new alert rule is added) you can continue managing the monitor from the dashboard.
If you email support#cronitor.io again with specifics I can help you with adding this rule via the API.

Implementing logging and retry mechanism in netsuite suitescripts

I am in need of a way to implement the error logging and providing a way to the admins to rtry any failure that occurs within a suitescript.
Here are my thoughts on the implementation:
Lets say for restlet i can log the datain, or the incoming data in any userevent script in a text file along with its status as success or failure. Later have a scheduled script to process that text file that may send those errors to my .Net Api and I can provide a way for Admins to retry.
Could anyone suggest me how its normally done in netsuite projects?
For similar systems, I typically advise you create Custom Records. Your custom records can have a field to store the raw data (JSON, xml, etc) as well as a Status (Succeeded, Failed, Retry, etc). You could consider retry mechanisms like having a User Event on the Custom Record that immediately retries upon creation of the record, then if that fails have a Map/Reduce that runs on a regular schedule to clean things up.
If the native Execution Logs aren't providing enough functionality for you in that respect, you can add a Custom Record for "logging" as well, but I'd suggest trying to use the native logs first. The Script Execution Logs UI provides reasonable searching/filtering capabilities.

Check whether cronjob has ran or not

I have one python script running in crontab, I want to check if it is running successfully or not? if not then send mail or another kind of notification. How do I notify based on Cron logs?
Things I already Tried:
All the Exception in python file I have already handled
Need: Notify user if Cron job is not running successfully?
In order to notify weather cron job running or not, you can set email id in cpanel 'cron jobs' page. so you will receive email once file get executed.
There are monitoring services specifically for cronjobs, doing exactly what you're asking for. I'm partial to WDT.io and here're the detailed instructions: https://cookbook.wdt.io/cron.html.

User event not firing on create event

I'm having a strange problem, where a user event, made to fire for sales orders on the Create event type, is not starting at all for some of them.
Trigger on: BEFORE SUBMIT FUNCTION
STATUS - Released
EVENT TYPE - Create
LOG LEVEL- Error
EXECUTE AS ROLE - Full Access
All access boxes are checked.
The only pattern I've found so far is that all failures are being created by a Script (Scheduled), which makes little sense to me...
Has anyone found a similar issue??
Do you want the scheduled script to trigger the user event script? Do you have the "All Roles" checkbox checked? I believe you need this to be checked for the UE script to be execute when the scheduled script creates a record.
You might want to check your scheduled script if it is error free. One possible reason why the user event script is not running is because the scheduled script has an error. Run your scheduled script first from the script debugger to see if there are errors.

Resources