Pass FormEntry to OnFormSaved event

Posted by Community Admin on 05-Aug-2018 22:10

Pass FormEntry to OnFormSaved event

All Replies

Posted by Community Admin on 21-Mar-2011 00:00

I am inheriting from FormsControl and subscribing to FormSaved. Problem is that I do not have any info on what was submitted. I was even ready to go so far as to querying the database for it, but not even a FormEntry id is passed as an args to the FormSaved event. Say I want to send the form submission to another system (which is why I am subscribing at this event in the first place). Please pass the FormEntry or FormEntry Id to the args of OnFormSaved in Telerik.Sitefinity.Modules.Forms.Web.UI.FormsControl.ProcessForm. Thanks.

Posted by Community Admin on 21-Mar-2011 00:00

Hello Basem,

You can get the submitted value from the FormControls properties. The FormControls contains a placeholder control which holds the form controls, so you can retrieve the submitted data

((Telerik.Sitefinity.Modules.Forms.Web.UI.Fields.FormTextBox)(this.FormControls.Controls[1].Controls[0])).DefaultStringValue

Kind regards,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 21-Mar-2011 00:00

Thanks Ivan. Although I think it would be really elegant to pass the parsed input values to the OnFormSaved (instead of 'this.OnFormSaved(null)'), I was able to make use of the below property of FormsControl:
"protected virtual List<IFormFieldControl><IFormFieldControl> FieldControls"

I just have to cast it with "FieldControl" in the loop to get the "Value" property of the field control. I hope this helps someone. Thanks again for the guidance.

Posted by Community Admin on 22-Mar-2011 00:00

Thanks guys, works for me as well

+1 vote for a more elegant way to get the data though

This thread is closed