AnsweredAssumed Answered

Continuing Serial Value

Question asked by JulioSandoval on Feb 10, 2017
Latest reply on Feb 13, 2017 by JulioSandoval



I currently have Two Tables.


Inspection Table --- Image Table


Both tables have unique IDs .


The image table has an ImageNum field that is serialized starting at 0001.

I have a calculation that renames the image to our liking. the ImageNum is part of that naming scheme.


When you create a new inspection, the ImageNum Serial is reset to 0001 using the

Set Next Serial Value [ImageTable::ImageNum ; "0001" ]   <--- Yes I know, it is not best to put quotations on numbers, but FM would NOT let me place any zeros in front.


What I can't figure out is how to tell that serial number to continue if I need to go back into an existing record and insert more images.


I have tried using the Set Next Serial Value with Max() function, but that just continues off of the current max Serial number.


So if I create a new inspection record, I insert 3 pictures, and those are set to 0001, 0002, 0003 respectively.


I can create a second inspection record and say I insert 4 pictures, the last picture will be 0004. Wonderful right?


But if I go back to the first inspection record I created, and insert an image, the serial number is 0005 instead of 0004... ...


So I have hit a wall. Granted, the pictures should/will be inserted before the record is completed, but just in case an image is forgotten and needs to be inserted, how can I continue the serial number properly?


Thank you all.