Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Eran Meir 401 posts 543 karma points
    Mar 23, 2013 @ 22:58
    Eran Meir
    0

    check if someone submitted a form with an email that was submitted before

    hi, i have a form with a field to store email, now i want to check if the email that the user submitted is not already submitted before and if it does display appropriate message,
    does anyone can direct me how to do it?

    i got an idea to do it with code first and then use the submit event and check it (still hasn't figured out how to check it) but i don't want to convert it, it will take me ages to convert it...
    thank you...

  • MK 429 posts 906 karma points
    Mar 24, 2013 @ 13:09
    MK
    100

    Hi Eran,

    Maybe this will help you:

    1. Reg the event:

     private void RecordService_RecordSubmitted(object sender, Umbraco.Forms.Core.RecordEventArgs e)
           {
               if (e.Form.Id == new Guid("a95f94d6-9b2f-443e-b603-b69db5c5cc07"))
               {
    }
    }

     2. search the entries

       string formId = "b62ffdb4-1620-44a6-8859-465f36b75b89";
        Umbraco.Forms.Data.Storage.RecordStorage rs = new Umbraco.Forms.Data.Storage.RecordStorage();
        Guid formGuidGuid = Guid.Parse(formId);
        var member = Membership.GetUser();
        var num = 0;
        if(Member.GetCurrentMember() != null)
           {
    
               string cm = Member.GetCurrentMember().LoginName;
               var records = rs.GetAllRecords(formGuidGuid)
                               .Where(c => c.GetRecordField("LoginName").Values.Count > 0 && c.GetRecordField("LoginName")
                               .Values[0].ToString() == cm)
                               .ToList();
                num = records.Count;
    
    
           }
    
  • Eran Meir 401 posts 543 karma points
    Mar 27, 2013 @ 15:04
    Eran Meir
    0

    thanks that helped me alot :)

  • Rizwan 29 posts 139 karma points
    Nov 30, 2017 @ 10:32
    Rizwan
    0

    Dear Eran,

    I have the exact same requirements, can you please share your solution with me.

    Thanks

  • MK 429 posts 906 karma points
    Mar 27, 2013 @ 16:37
    MK
    0

    You welcome.

    Its the least I can do...

  • Rohith Racherla 9 posts 79 karma points
    Jul 18, 2016 @ 13:53
    Rohith Racherla
    0

    I am using Umbraco forms 4.3.2 and there is no RecordService in the form services?

    how can I register record submitted event without the record service

Please Sign in or register to post replies

Write your reply to:

Draft