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 ...

4 replies

null
    • Independent Developer
    • WILLIAM_PORTER
    • 1 yr 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?

      • giuseppe
      • 1 yr 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

      • Paul_Chappell
      • 1 yr ago
      • Reported - view

      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.

    • Fred
    • 1 yr 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.

Content aside

  • 1 yr agoLast active
  • 4Replies
  • 79Views
  • 4 Following