Copied to clipboard

Flag this post as spam?

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


  • Craig O'Mahony 343 posts 885 karma points
    Apr 16, 2018 @ 08:50
    Craig O'Mahony
    0

    Programmatically remove Contour Form entries

    Hi,

    I would if someone could give me some advice please...

    As part of the upcoming GDPR changes my company has imposed a data retention policy of one month meaning that we're not permitted to keep information that's greater than a month old.

    On two of the sites (a version 7 and a version 4 build) I'm running Umbraco Contour and I've been asked if a schedule could be created that deletes form entries that are greater than a month old.

    So 2 questions really does anyone have any knowledge of programmatically removing form entries and what would be the best way of creating a scheduled task to fire this programmatic solution.

    I've created a scheduled task that runs on a server that fires a web page which runs code when loaded but any sort of browser 'issue' (i.e. Internet Explorer didn't shut down properly) causes the schedule task to fail so this solution is unstable for this request really.

    Thanks in advance, C

  • Balram Narad 33 posts 74 karma points
    Apr 16, 2018 @ 09:50
    Balram Narad
    1

    I'm not sure if this will help but we run a sql script shown below that clears our form entries from the previous 14 days. The script is run daily via a schedule. You can amend it to do previous 28 days by just changing the 14 to 28 if you need to delete last calendar month then you will need to add some code work that out.

    Delete FROM [dbname].[dbo].[UFRecords] Where Created < GETDATE() -14

    Hope that helps

    Bal

  • Craig O'Mahony 343 posts 885 karma points
    Apr 17, 2018 @ 07:35
    Craig O'Mahony
    0

    Hi Balram,

    So just to confirm this deletes Contour records from the last 14 days??

    If that's the case then that's awesome work!

    Thanks, C

  • Balram Narad 33 posts 74 karma points
    Apr 17, 2018 @ 09:11
    Balram Narad
    0

    Hi Craig

    Yes this is what we are using to clear down our form entries.

    Bal

  • Craig O'Mahony 343 posts 885 karma points
    Apr 18, 2018 @ 15:38
    Craig O'Mahony
    0

    That's brilliant thanks for your time

    :)

  • Amir Khan 861 posts 1510 karma points
    Apr 18, 2018 @ 18:36
    Amir Khan
    0

    So would this just delete all of the entries?

    Delete FROM [dbname].[dbo].[UFRecords]

  • Balram Narad 33 posts 74 karma points
    Apr 19, 2018 @ 08:50
    Balram Narad
    0

    Hi Amir

    yes it would

    Bal

Please Sign in or register to post replies

Write your reply to:

Draft