SaaS CMS has officially launched! Learn more now.

XForms - Database

Vote:
 

Hi,

Is there a way to stop the data from being stored in the database as we use a different CRM to send the data to? We still need the Send to Database checkbox but to use a webservice to send the form data.

Thanks

Jon

#193914
Jun 07, 2018 15:05
Vote:
 

Hi Jonathan,

It's been a while since I've had to do it but, as I recall, you'll need to tie in to the BeforeSubmitPostedData event and do something like the following:

private void XForm_BeforeSubmitPostedData(object sender, SaveFormDataEventArgs e)
{
    if ((e.FormData.ChannelOptions & ChannelOptions.Database) == ChannelOptions.Database)
    {
        e.FormData.ChannelOptions &= ~ChannelOptions.Database;
    }
}



#193967
Jun 08, 2018 16:47
Vote:
 

If its an option then you could look into using the new Episerver Forms. You can choose to not save to the database out of the box. 

https://world.episerver.com/add-ons/episerver-forms/

David

#193968
Jun 08, 2018 17:05
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.