I have a requirement to cancel a send if certain conditions are not met. My current code cancels the send, but does not log the conditions. According to the RaiseError Documentation, the last term (boolean
)
Indicates whether the function records information to data extensions before error occurs, even if the process skips the subscriber. A value of 1 retains information written to data extensions before the error occurs, even if the subscriber is skipped. A value of 0 does not retain information recorded before the error. This parameter refers to inserted, updated, upserted, or deleted information via AMPscript.
so if my understanding is right, putting a value of 1
here so log the error.
Here is a copy of my code:
SET @rows2 = LookUpOrderedRows('ENT.Presend Agreement Log',1,'DateAdded Desc','email_name',emailname_)
IF RowCount(@rows2) == 0
THEN
SET @Message ="Loren Ipsum"
/*Should this be an upsert??*/
UpsertDE('ENT.Presend Agreement Error Log',1,
'email_name',emailname_,
'error_message',@Message)
RaiseError(@Message, false,1)
ENDIF
Would appreciate any pointers here