0

Sequential numbering

I“m trying to get each entry on a suitable to be numbered 1-2-3 etc each time a new instance of the subtable is created. So, the main table represents a ”Job“ and each entry on the subtable represents a ”visit“ (numbered sequentially).

8 replies

null
    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    this is just one way to do it - other will advise you of other methods

    in the trigger on create of the subtable myJobs) assuming your subtable (child) is MyJobs

    and the number field wher to numbering is to increment is called something like “Job Bag No”

    enter this script

    let before := max((select MyJobs).“Job Bag No”);
    “Job Bag No” := before + 1

    “Job bags No” needs to be a number field

    Then when you creare a NEW entry it will auto number

    after the plus + you can put any value in steps ie  2 or 6 etc

    Note: if it does not appear to work add the first number manually into the first record ie 0 or 1 

    Mel

    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    heres mine in one of my forms

     

    and here is the result

    • Mel_Charles
    • 3 yrs ago
    • Reported - view
    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    dunno why the screen shots not loaded - never ever done that before but you get the idea from the script

    • Mel_Charles
    • 3 yrs ago
    • Reported - view
    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    Nope def broken !!!

    • drewbroughton
    • 3 yrs ago
    • Reported - view

    Thanks for the reply. Unfortunately, the numbering increments from a “global” position (not from “1”) per instance of subtable creation. I“d appreciate some more ideas!

Content aside

  • 3 yrs agoLast active
  • 8Replies
  • 595Views