0

Automatically create a record when a date expires

I have a table called "Jobs". This has a sub-table called "Workings". In the "jobs" table there is a "Date" field that I set manually. I would like to create a formula that, when the date specified in the "Date" field arrives, automatically creates a record in the "Workings" sub-table, associated with the parent table. I can't find solutions ...

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • WILLIAM PORTER
    • Independent Developer
    • WILLIAM_PORTER
    • 3 mths ago
    • Reported - view

    Why don't you just create the child record in Workings at the same time? If it's linked to the Job record, which has a date, then you can simply filter both of them out of view with a filter showing only records whose JobDate > today. Would not that work?

    Like 1
      • giuseppe
      • giuseppe
      • 3 mths ago
      • Reported - view

      WILLIAM PORTER Because the creation of that record involves a series of actions on my part that can only happen after the expiration date

      Like
    • giuseppe Do you want to create a 'Workings' record automatically, or only after a series of actions?  If automatically, and Workings is a hidden sub-table then WILLIAM PORTER suggestion would work best. If you have to carry out a series of actions first then why not link one of those actions to creating the new record by a 'Trigger after update' script.

      Like
    • Fred
    • Fred
    • 3 mths ago
    • Reported - view

    You can try this in a button on the Jobs table:

    let t := this
    if DateFieldName < today() then
    let newRec := (create Workings)
    newRec.(Jobs := t;
            DateExpired := t.DateFieldName)
    end
    

    Of course you need to change the names of the tables and fields so they match yours.

    Let me know if that works then we can add a loop so you can add it to the Trigger after Open of the table Jobs.

    Like
Like Follow
  • 3 mths agoLast active
  • 4Replies
  • 50Views
  • 4 Following