3

I am using Web Forms for Marketers 8.2.rev. 170518

I have made a save action that does nothing except throwing an exception. This is my first save action:

public class FailAction : ISaveAction
{
    public ID ActionID { get; set; }

    public ActionType ActionType { get; set; }

    public string UniqueKey { get; set; }

    public ActionState QueryState(ActionQueryContext queryContext)
    {
        return ActionState.Enabled;
    }

    public void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null, params object[] data)
    {
        throw new Exception("Fail Action has failed", null);
    }
}

But now the other Save Actions are executed as well, like sending email etc.

What can I do to prevent the other save actions to be executed if a previous save actions fail? Or do I need more than just an exception to make a save action "fail"?

Regards

3

I found this blog https://www.exlrt.com/blog/handling-faulted-state-in-sitecore-wffm-save-actions that mentions this behavior as a bug in WFFM in older versions but it might be still present in yours.

WFFM does handle faulted state in form verification actions, but not in save actions. A while ago, I have filed a support ticket (#441302) for this incorrect behavior and the support team has registered it as a bug in Sitecore WFFM 8.0 rev. 150224. That was when I used Sitecore 8.0 Update 2. Now, with Sitecore 8.1 Update 2, still the same version of WFFM is used and that means the bug is still present.

The solution presented in the blog is to create your own "error" state (a context value) which works with custom save actions but (as they also mention) not with the ootb ones.

So I would reach out to Sitecore Support and ask them (maybe refer to that post).

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.