Error log

Hi,

Im doing bulk import of data from staging table to target table through x++.

I need to capture the error log for each record and update it in a field in the staging table.

catch(Exception::Error)

{

stagingTable.log = infolog.text();

}

Whenever an error is captured it writes the error into the staging table.It works fine when it is executed in a non-batch mode.

When the import process is run as a batch job , the log is not updated correctly in the staging table.

During batch job, it updates just the first line of the infolog to all the erroneous records without updating the infolog for the coresponding record.

For example, against the 2nd record (000122idfgf) record it updates "BOM : 000121 000121 is created " instead of updating the actual error message for that record which should be “Number 000122idfgf does not match format ######.”

Kindly guide on how to achieve this.

Thanks & Regards,

Chutti

I guess you’re using AX 2012 (unfortunately you forgot to attach a tag with your AX version) and it happens if you run the code in CIL (even outside batch). Is it correct?

Hi Martin,

Thanks for the response.

Im using AX2012 R3 CU10 . As you said this happens when running the code in CIL (even outside batch).

Thanks & Regards,

Chutti.

When it actually works? How are you deciding it to Run in IL?

Hi Kranthi,

It actually works when the "Execute business operations on CIL " check box is unchecked and run in a non-batch mode.

Thanks & Regards,

Chutti