• Maja Pasaric
  • 10 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 0

Hello everyone,

I am trying to make a simple web shop. I have a custom object Basket (the shopping cart) that holds BasketLineItems (the chosen goods, custom objects as well) and has a field with a lookup for Contact objects (representing the customer). The Basket doesn't need to have the contact field filled in at the point of its creation, but if it doesn't get filled within 24 hours, the Basket record in question should be deleted.

I've searched around and so far, the best way seems to make a Scheduled Apex class and have it run frequently, every hour or so, checking creation times and deleting accordingly, but that means it's possible for a record to exist for more than 24 hours, plus it's a pain and a strain to schedule the job more frequently. Can't I make something that's basically a timebomb and stick it to the record?