Issue with data submission service after upgrading to CMS 12

Vote:
 

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.

#306627
Aug 11, 2023 8:57
Vote:
 

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.

Thanks

Paul

#306628
Aug 11, 2023 9:05
Vote:
 

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...

#306766
Aug 14, 2023 10:08
Vote:
 

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.  

#307195
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.