Try our conversational search powered by Generative AI!

Issue with data submission service after upgrading to CMS 12


In our solution we have a class, CustomDataSubmissionService, that inherits EPiServer.Forms.Core.Internal.DataSubmissionService and overrides the methods BuildReturnResultForSubmitAction, BuildSubmissionResultData and PerformDataSubmit. After the upgrade of both CMS and forms, CustomDataSubmissionService is no longer called when a form is submitted. In Startup.cs we have Services.AddTransient<DataSubmissionService, CustomDataSubmissionService>();

What could we be doing wrong? I've found very little information about DataSubmissionService. Maybe it is because it is an internal class and not intended to be used? Could it even be so bad that it actually can't be used anymore? And if so, are there any good alternatives? We are using this functionality to relay submitted documents to other systems, creating cookies based on input, fighting spambots etc.

Aug 11, 2023 8:57

Hi Andvik,

Yeah I would presume too that as it is internal is is susceptible to frequent change.

An alternative for you to use is either a submission actor or a web hook.

Using these you would be able to tie into your existing solution.



Aug 11, 2023 9:05

Can you show how you register your CustomDataSubmissionService in the Startup.cs? The order is important

Make sure you add this line Services.AddTransient<DataSubmissionService, CustomDataSubmissionService>(); after the Services.AddCms...

Aug 14, 2023 10:08

Thank you Paul and Bac! Relying on internal functionality seems a bit unsafe and we would probably be better off changing to ordered submission actors. But, yay!, amending the order in Startup.cs did the trick.  

Aug 21, 2023 7:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.