I have a scenario where I want to block an entire send when a specific flag is "True" and insert an error message into custom error log Data Extension.Basic logic flow is,
IF (errorFlag) THEN InsertDE("DE External Key", "ErrorColumnName", "Error Message") raiseError("Error Message", false)ENDIF
The problem I am facing here is,
- I am using raiseError that blocks the entire send if the custom errorflag is true ( RaiseError("error message“), false)). As per ampscript documentation, insertDE function will not execute if raiseError that blocks the entire send is used, because insert operations are processed only when the send is completed.
- Tried using last argument of raiseError funtion which preserves the insert operation before raising the error, but that is not working when block entire send option is used.
- InsertData function will not work in email send. So that option is also not available.
- Tried calling a separate content block when error flag condition is met and performing insertion using SSJS then come back to the previous content block and execute the raiseError. Even that is failing.
Is there any way we can insert the error message to DE using any possible method and then call raiseError() to block the entire send?