What is the expected behavior using error=true in transform script ?

Tony12
Kilo Contributor

I have requirement where onBefore script need to count the errors using error=true.

But the challenge here the process NOT picking up next row to execute and stuck/lock the schedular job.

How to mitigate this challenge, where I need error counts + error message + proceed till last row and execute OnComplete script as well.

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage
errorBooleanWhen set to true, will halt the entire transformation for the current import set, with an error message.

 

If you want to continue use:

ignoreBooleanWhen set to true, the current row transformation will be skipped and the remaining rows will be processed.

If you have defined an onAfter script, the onAfter script runs for the current row even if the ignore flag is set to true.

 

You can log an error with

log.error()

logFunctionThe log object for the current import run. For example, log.info(...), log.warn(...), log.error(...).

 

https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/refe...

View solution in original post

4 REPLIES 4

Willem
Giga Sage
Giga Sage
errorBooleanWhen set to true, will halt the entire transformation for the current import set, with an error message.

 

If you want to continue use:

ignoreBooleanWhen set to true, the current row transformation will be skipped and the remaining rows will be processed.

If you have defined an onAfter script, the onAfter script runs for the current row even if the ignore flag is set to true.

 

You can log an error with

log.error()

logFunctionThe log object for the current import run. For example, log.info(...), log.warn(...), log.error(...).

 

https://docs.servicenow.com/bundle/orlando-platform-administration/page/script/server-scripting/refe...

Tony12
Kilo Contributor

Thanks Willem for quick response.

Can I know where is the log.error() captured and how to find the logs ?

 

On the Import set related list 'Import Set Run' open a run:

find_real_file.png

 

Then you see:

find_real_file.png

Level will be Error

Tony12
Kilo Contributor

Thank You !!