Copied to clipboard

Flag this post as spam?

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


  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 11, 2016 @ 16:34
    Frans de Jong
    0

    Edit forms entry

    Is there a way to edit a forms entry?

    I have the form Guid and the entry Id. I'd like to render the form with current values prefilled and overwrite them on submit.

    If that isn't possible It'd be okay to delete the entry and save the new one.

    The documentation on Forms is to basic to find stuff like this...

    I've been looking for a solution for a day now. And I'm starting to think there isn't one...

    Thanks, Frans

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 12, 2016 @ 09:23
    Dennis Aaen
    1

    Hi Frans,

    The feature you are using here is actually a symptom of a huge security gap - as we patched a security issue in the latest release this functionality was removed - so while you might have used it before, it did leave your site vulnerable.

    Have you seen this blog post. https://umbraco.com/follow-us/blog-archive/2016/1/27/umbraco-forms-security-notice/ ?

    We are working on an actual supported way to editing form records which are secure.

    /Dennis

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 09:29
    Frans de Jong
    0

    Hi Dennis,

    I'm using the default forms on Umbraco 7.3.7 witch I installed yesterday. So the bug still exists or Umbraco 7.3.7 installs a old version of forms. But I don't get a update notice..

    How can I check the forms version?

    Frans

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 09:55
    Frans de Jong
    0

    I found the version number. I'm using 4.1.5 and this code still works:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using Umbraco.Forms.Data.Storage
    @using Umbraco.Forms.Mvc
    @using Umbraco.Forms.Mvc.DynamicObjects
    @using Umbraco.Forms.Web.Services
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
       var formGuid = CurrentPage.formpicker;
       var form = Library.GetRecordsFromForm(formGuid);
       string entryId = "";
    }
    
    
    @if (form != null)
        {
            <ul>
                @foreach (var record in form.Items)
                {
                    <li>
                        @record.Id.ToString()
                        <ul>
                            @foreach (var field in record.RecordFields)
                            {
                                <li>@field.Value.Field.Caption - @field.Value.ValuesAsString()</li>
                                if (field.Value.Field.Caption == "MemberId")
                                {
                                    if (field.Value.ValuesAsString() == umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id.ToString())
                                    {
                                        <strong>FormId = @formGuid    Entry Id = @record.Id</strong>
                                        entryId = record.Id;
                                    }
                                }
                            }
                        </ul>
                    </li>
                }
            </ul>
    
        }
    
  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 12, 2016 @ 09:57
    Dennis Aaen
    1

    Hi Frans,

    If you go into the developer section, and open up the package folder. You will see a folder with installed packages, in there you can find the version number.

    You should be running Umbraco 4.1.5, where we have removed the option.

    /Dennis

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 09:59
    Frans de Jong
    0

    See the post above yours. I'm running 4.1.5

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 12, 2016 @ 10:04
    Dennis Aaen
    1

    Hi Frans,

    It´s perfectly fine fetching it that way in code

    /Dennis

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 10:07
    Frans de Jong
    0

    Ok.

    But is there a way to overwrite the record by recordId? Or is this impossible in a partial view/template right now?

    Can I delete a record from partial view/template?

    I can't find this info in the docs.

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Feb 12, 2016 @ 10:27
    Warren Buckley
    1

    Hello Frans
    You will need to look at RecordService

    A simple example after of getting the Record/Form submission after the form has been submitted would be like so

    var record = RecordService.Instance.GetRecordFromTempData(TempData);
    RecordService.Instance.Delete(record, record.GetForm());
    

    And an update example

    var record = RecordService.Instance.GetRecordFromTempData(TempData);
    
    using (var rs = new RecordStorage())
    {
        rs.UpdateRecord(record, record.GetForm());
    }
    

    I hope this little snippets give you some insight or pointers to get started.

    Thanks,
    Warren

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 10:33
    Frans de Jong
    1

    Hi Warren,

    Nice snippets. Thanks! Where did you find documentation on the recordservice?

    I have to use the records from a Guid and not from tempdata. So I have to look through the documentation, if it's available.

    Frans

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Feb 12, 2016 @ 11:04
    Warren Buckley
    1

    Hello Frans,
    I have recently joined the team at Umbraco to work on Forms, so I am starting to know my way around the code base.

    Unfortunately the documentation needs further work and is something on my radar that needs doing.

    If you start looking into RecordService & RecordStorage then you should be able to discover what you can do.

    As Forms in built on top of Contour some of the same pieces are still applicable
    https://our.umbraco.org/projects/umbraco-pro/contour/documentation/
    https://our.umbraco.org/documentation/Products/UmbracoForms/

    Thanks,
    Warren

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Feb 12, 2016 @ 12:08
    Frans de Jong
    0

    In your example you're using:

    RecordService.Instance.Delete(record, record.GetForm());
    

    and:

    rs.UpdateRecord(record, record.GetForm());
    

    What is it expecting in its arguments?

    Your var record contains: Umbraco.Forms.Core.Record because you use RecordService.Instance.GetRecordFromTempData(TempData);

    Since I'm not looking for the current record but looping through all the records of a form I get: Umbraco.Forms.Mvc.DynamicObjects.DynamicRecord by using Library.GetRecordsFromForm(formGuid)

    The DynamicRecord doesn't contain GetForm(). Is it expecting the form Guid or some object?

    Thanks

  • Manjunatha Govindappa 20 posts 119 karma points
    Feb 15, 2016 @ 11:46
    Manjunatha Govindappa
    0

    Hi I am new to umbraco forms. I have the following requirement, We will Implement a Membership and after members login will get access to some of the forms. What I am looking now is does the member is able to edit the data entered using umbraco forms?

    After reading this post it looks like once data is submitted members will not be able to edit. Please suggest how to do it with umbraco 7.3 version

  • Dan Evans 629 posts 1016 karma points
    Mar 08, 2016 @ 17:23
    Dan Evans
    0

    Is there any news on when it will be possible to edit form data after it has been submitted? This would be very useful.

    Thanks!

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Mar 09, 2016 @ 12:02
    Warren Buckley
    0

    Hello Dan,
    This is currently been worked on this sprint and is aimed for 4.2.2 release and is waiting for internal review

    http://issues.umbraco.org/issue/CON-920

    Thanks,
    Warren

  • Dan Evans 629 posts 1016 karma points
    Mar 09, 2016 @ 12:17
    Dan Evans
    0

    That's great news. Do you have a rough estimate on a date for this?

    If we needed to do this urgently is it something we could write using the Forms API?

    Thanks

    Dan

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Aug 29, 2016 @ 06:51
    Frans de Jong
    0

    For a upcoming project we need the ability to change a form entry. If a site ember has filled in a form on a page he needs to be able to change the entry for that member in the current form.

    Can someone confirm this is possible now?

    Thanks

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Aug 30, 2016 @ 08:24
    Frans de Jong
    0

    Twitter conversation on this topic for future reference:

    • @warrenbuckley Is there any documentation regarding the editing of a Umbraco forms entry?
    • @FranscdeJong as in using the UI?
    • @warrenbuckley As in programmatically. A logged in user needs to be
      able to change his entry.
    • @FranscdeJong yes possible. There is a config setting to enable it
      and then you use a querystring of ?recordId=GUIDofSubmission
    • @warrenbuckley So check the current form with formguid, loop through entrys looking for logged in user than get entry by entryguid and
      save?
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Aug 30, 2016 @ 08:37
    Warren Buckley
    0

    Hello Frans,
    This was rectified in this issue here - http://issues.umbraco.org/issue/CON-920

    So you need to enable the config setting AllowEditableFormSubmissions and then use the querystring ?recordId=GUIDofRecordSubmission

    I hope this helps you.

    Thanks,
    Warren

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Aug 30, 2016 @ 08:44
    Frans de Jong
    0

    Whats not clear for me is how to get the GUIDofRecordSubmission for the current user for the current form?

    That still requires looping through the entrys right?

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Aug 30, 2016 @ 08:50
    Warren Buckley
    100

    Yes Frans you will need to do some of your own logic to fetch the RecordGUID you want.

  • Frans de Jong 548 posts 1840 karma points MVP 3x c-trib
    Aug 30, 2016 @ 08:52
    Frans de Jong
    0

    Ok, thanks!

    Frans

  • Antoine Bergeron 18 posts 107 karma points
    Nov 11, 2016 @ 20:02
    Antoine Bergeron
    0

    Having the programmatical way to edit is nice. However, is there a way to edit in the backend UI planned in the future?

    Also, I'm wondering, if we edit a entry this way, are any of the workflow items triggered?

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Nov 14, 2016 @ 09:01
    Warren Buckley
    0

    Hi Antoine,
    Yes it is planned to allow the backoffice form entries viewer to edit a submission in the future, however I cannot give you a time frame for this right now.

    Yes any workflows would be re-triggered after an edit too at this point in time.

    Hope that helps you.

  • horsted 74 posts 136 karma points
    Nov 22, 2016 @ 15:14
    horsted
    0

    Hi Warren,

    We use umbraco Forms for event signup and often people submit incorrect data and afterwards email us to correct their typo mistakes, which is close to impossible...

    Backend form entry editing would be MUCH appriciated, and is actually the only feature we are missing, so hope this get prioritized :-)

    Thanks in advance!

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Nov 28, 2016 @ 09:25
    Warren Buckley
    0

    Hi Horsted,
    Yes we are aware that this is currently missing, feel free to go over on the issue tracker and vote the issue up.

    http://issues.umbraco.org

    Many Thanks,
    Warren

  • horsted 74 posts 136 karma points
    Nov 28, 2016 @ 20:39
    horsted
    0

    Hi Warren,

    Thank you for taking the time to reply! I believe this is the issue - http://issues.umbraco.org/issue/CON-786 - and I voted for it!

    Thanks, Casper

Please Sign in or register to post replies

Write your reply to:

Draft