AnsweredAssumed Answered

Help with auto calculation of serial

Question asked by JohnDee on Nov 7, 2013
Latest reply on Nov 7, 2013 by philmodjunk

Title

Help with auto calculation of serial

Post

     My Serial format is as follows YY-XXX, year last two digits, and  a 001-999 serial.

      

     I was wrongly under the impression that the following code, that checks to see what year it is, and if it’s the same it increments, if it’s new it starts anew, was correct:

      

     If  ( Left ( GetNthRecord(_pkProject_Serial_Number; Get(RecordNumber) -1) ; 2 )  =  Right ( Get(CurrentDate) ; 2) ; SerialIncrement(GetNthRecord(_pkProject_Serial_Number; Get(RecordNumber) -1);1); Right ( Get(CurrentDate) ; 2) & "001")

     Sadly is not, after a find request, or in between records.

      

     I tried to change it as follows but now I don’t get ANY serials.

      

     If  ( Left ( GetNthRecord(_pkProject_Serial_Number; Get(TotalRecordCount) -1) ; 2 )  =  Right ( Get(CurrentDate) ; 2) ; SerialIncrement(GetNthRecord(_pkProject_Serial_Number; Get(TotalRecordCount) -1);1); Right ( Get(CurrentDate) ; 2) & "001")

      

      

     I thought about scripting it, but to no avail. ANY help much appreciated. 

Outcomes