Help

Re: Scripting block to delete records in table that have been modified within 5 minutes of the time of running the script

1524 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Joseph_Sicurel1
4 - Data Explorer
4 - Data Explorer

Hi all.

I am working with a table that has a ‘Last Modified Time’ field. I am attempting to create a block script that when run deletes any records that table within 5 minutes of Last Modified Time field.

I am new to scripting so any help is appreciated!

5 Replies 5

You’ll have to be more specific about this requirement.

Imagine it’s 10a and you decide to run the script to perform the deletions. There are many records with times that are far greater than 5 minutes ago. Are you saying that any items >= 5 minutes old should be preserved? What if you forget to run the script? Should it delete everything that is 5 minutes old or more?

Hi Bill.

I actually didn’t consider all that! Yes, it would be better to delete records where the last modified time field falls within a date range. I like the control of having to run the script block when needed, even if it that mean forgetting to run it, which is not really to much an issue if I do.

Any further help is much appreciated.

Thank you.

Precisely.

I recommend you explain all the nuances of what you’re looking to achieve because getting to the details is very costly in terms of time. Even go so far as to create a simple outline of the process steps with a few examples. Without details, people who know how to code it up, must also have to become your scribe and interpreter of what’s in your head. :winking_face: Once you do that, someone will jump on your idea to help.

Bill,

Yes, fair enough.

Thank you for your help!

Joseph

You bet. And with deeper details, you’ll get a much better solution.

So many [free] scripts have been shared here by community members who quickly learn they spent a few hours writing something without all the facts. Then the long and painful process of shaping the tool to do what was really needed begins.

Just as there’s a subtle difference between standing on the shore drunk and fishing, there’s an equally subtle difference between creating a script and actually implementing a script. :winking_face: