delete old data

delete old data

after 30 days i want the old data to be automatically deleted .. how do i go about doing this...
( Outsystems vs 8)
Hi Sat,

I think you can build a user action to do that and then add a timer in the "processes" tab, schedule him to execute the action you builded in the day of the month you want.

Best regards.
Thank-you this is exactly what i have been trying to do.. as an inexperienced developer/ outsystems developer is it possible to provide me with a step by step guide ?

Kind Regards
I have tried this but it doesnt seem to work.. what is it that i am doing incorrectly ?
Hi Sat,

I let an example showing what I think it's a best approach to what you want to do.
I created a logic action, then I set a timer to run that action in the last day of every month.
The action will delete the records from the table for the last 30 days.
If you liked this approach try adapt for what you want.

Best regards.

I cannot open the link as i am working on version 8
Try to understand the pictures I let.

Any doubt ask.
This helps thank -you.. as an inexperienced developer... i have a few questions

is this an action within the logic function
what sql code you input into the SQL advanced query
1) Yes, because to use an action on a timer it's have to be a logic user action.
2)equal to yours, but with (-30) on second adding days attribute. Because we want the last tirthy days right?
Already anwsered on my last post.
Thank-you i will try it shortly - yes it was -1 so i could test it :)
This doesnt work...Is there something i am missing ...please see screen shots
Hi Sat,

in third picture, you have a query with "DELETE from...." you must have "SELECT from...". The action to delete data will take effect on the action "DeleteEventCalendar" that you have in your "For Each" cycle.
Pay attention to your schedule, because exist months that don't have 31 the next February, so if you say that the action must be taken in 31º day of every month, at some months these action will not have effect....

Best regards,
Thanks - I didnt think of the days thing i thought it would automatically calculate 30 days ... if i change it to 27 i should be covered ?

when i put in SELECT it come up with a warning message ... ref attachment
If you change to 27 it should be covered yes.

In your query, after the SELECT, you must set at least one attribute from your entity that query must search for, like ex: name, date, etc...
other your expression you must change "Add(CurrDate(),-30)" to "DATEADD(day,-30,Getdate())"
I am still getting errors

I think i may be over complicating this process a little bit...

I have an entity called DateTime - this is where the user enters the date of an event

once the event date has passed i want the event to be automatically deleted from the list
Deleted from the list (don't show) or from your database? The approach it's different for both situations.
From both?
From a Record List it's simple, you have to put a clause in your query, that you use to populate your record list,  for only show the dates from the last 30 days.
To delete the data from your entities, the approach it's what you are trying to implement...
can you be more specific where are the problems? The queries don't produce results? or you have results on the queries but you can not delete them? Can you send .oml file for we take a look an try to figure where is the problem?
when the date has passed i want the event to be deleted .. please see screenshot i hope this help...

If i understood you want that the list only show the present and upcoming events right? So in query you use to populate that list you have to put a clause, for example,"dateTime>=GetDate()" so that only the current date and upcoming dates are shown in your list. 

so would this go in the preperation of the page

and what exactly should the query state