On Sales Order line > Product and Supply > Configure Line
We are doing same process code in our customized code
this.configurelineprocess(xxx) ; // This is just to show we are using configuring process
How can i capture the error logs that occur during this process and save it in a table Error Log Table?
we are running this process in batch so in case if we had any errors during process we need to see those errors somewhere. So we need to capture the errors .
If you run it in batch, infolog messages are already logged. So maybe you don’t need any customization.
But if you want, you can record infolog messages by yourself. infolog.copy() gives you infolog messages; infologLine() gives you line numbers you need for that.
I am reading files from a folder and processing those using batch. I had a staging area of all the files that we read. So during batch job process if any error occurs i need to capture that and add it to staging area Error log . So user can go and click that record and check error log to find out what is the error?
It is - it’s in the second paragraph of my first reply.
But you should write custom code only if the standard feature isn’t suitable. Note that you can also create custom form on the data collected automatically, instead of duplicating the logic.
The best code is code that you don’t have to design, write, debug and maintain.
We used Try and catch block, then like you said we used infolog.copy() and copied the messages inside that and looped through those messages and displaying it in the error log.