2

Wondering if anyone can shed light on ordinals #3-5 for the RaiseError() function? Particularly interested in #5.

Ref: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/raiseerror.htm

7

RaiseError(1, 2, 3, 4, 5)

  1. Your custom error message to display once error is pushed.

  2. Indicator for if the function will continue throughout the dataset of your subscribers, or cancel the entire job. This is mostly only used inside send time environments. True (1) skips to the next subscriber, False (0) halts the process completely.

  3. This is the custom 'API Error code' that you can set. The API Error code is kept in the error log (which I believe is only viewable to SFMC, but I believe you can get part of it via 'NotSent' tracking extract) and any send log you have set up. The error code is not a number, but a small descriptor. e.g. 'Unsubscribed'.

  4. 'API error number' is a custom set number you set that is sent to the error log and send log same as API Error Code. This number, like the code, would mostly be used for your own reference only and does not affect anything else.

  5. If you set this to True (1), then it will allow all the processed information (via Update, Insert, Upsert AMPScript or SSJS functions) prior to RaiseError to still be processed and inserted/updated. If you set this to False (0) then any processed information that you had set prior to the RaiseError will not be added in or updated.

Check here for a full list of existing error codes and numbers

To further elaborate on #5, Think of it like this:

With True:

%%[
    UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1)

    if @broken == 1 THEN

        RaiseError("Broken", true, "Broken", 66, 1)

    endif
]%%

The Upsert Function will still process and the record will be inserted/updated on the @yourDE Data Extension.

With True:

%%[
    UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1)

    if @broken == 1 THEN

        RaiseError("Broken", true, "Broken", 66, 0)

    endif
]%%

The Upsert Function will NOT be processed and the record will NOT be inserted/updated on the @yourDE Data Extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.