• Resolved macsolve

    (@macsolve)


    Can a submission to Salesforce be prevented if we detect that the content is unwanted? For example using return false from salesforce_w2l_before_submit or salesforce_w2l_post_data

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author brilliantplugins

    (@brilliantplugins)

    If there’s no data to post, the plugin can’t post it.

    You may want to consider a custom validation function instead as that would allow you to provide feedback to the user (if that is desired). Though you could also filter the success message to indicate the submission was unsuccessful (though it should present a general error message by default).

    See the hooks & filters for details.

    Thread Starter macsolve

    (@macsolve)

    I have a function that sends relevant fields to Akismet API, and if the result is spam the submission should be stopped. It sounds like return false from salesforce_w2l_before_submit should do that by making sure there is no data to post.

    Using sfwp2l_validate_field filter seems to only have access to one field at a time, but Akismet needs access to multiple fields for the spam filtering.

    Thanks for the tip to filter the success message to provide proper feedback!

    Thread Starter macsolve

    (@macsolve)

    Having salesforce_w2l_post_data return an empty array effectively prevents submission, since there is no organization id that tells Salesforce where the submission belongs. So this is a usable solution.

    return array();

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent submission’ is closed to new replies.