More in this section
Forums / Suggestions / Pass FormEntry to OnFormSaved event

Pass FormEntry to OnFormSaved event

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 1 answered
  1. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    21 Mar 2011
    Link to this post
    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.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Mar 2011
    Link to this post
    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
    Answered
  3. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    21 Mar 2011
    Link to this post
    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.
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    22 Mar 2011
    Link to this post
    Thanks guys, works for me as well

    +1 vote for a more elegant way to get the data though
4 posts, 1 answered