Skip to main content

Search

Search

Ability To Serialize Grouped By Some Field

Comments

5 comments

  • Avatar
    Ian Cummings
    Moderator
    Are you wanting the serial number to reset based on the value in a database field no matter if it is a new record or not, or is it resetting for each new record where the record might be printed X number of times?

    I suppose either way, what you will want to do is create your serial number in an event based VB script which will reset its value back to 1 at the appropriate time. Therefore, for the first condition I mention you could use the "OnSerialize" or "OnIdenticalCopy" event to test the value of the field, compare it to the previous one, and then reset the value of the serial number if the two differ. The second condition would simple set the serial number to zero in the "OneNewRecord" event.
    0
  • Avatar
    Legacy Poster
    [quote name='Ian C - Seagull Support' timestamp='1320395869' post='975']
    Are you wanting the serial number to reset based on the value in a database field no matter if it is a new record or not, or is it resetting for each new record where the record might be printed X number of times?

    I suppose either way, what you will want to do is create your serial number in an event based VB script which will reset its value back to 1 at the appropriate time. Therefore, for the first condition I mention you could use the "OnSerialize" or "OnIdenticalCopy" event to test the value of the field, compare it to the previous one, and then reset the value of the serial number if the two differ. The second condition would simple set the serial number to zero in the "OneNewRecord" event.
    [/quote]

    I tried to set values in these script events, but just kept getting the error "Cannot write to read only value". How do I set the value of the counter through VB?
    0
  • Avatar
    Legacy Poster
    In addition to nRyder's question, I have a clarification.

    The serialized field does not automatically 'reset' whenever a new 'part' is encountered. It is instead to count the number of times a specific part was entered, even when shut down and restarted it will need to know what the previous values were.

    So in essence it needs to increment the serial from the last time that part was entered.

    In my example you will notice that when the part goes from part1 (label 2) to part2 (label 3) and back to part1 (label 4) the serialization continues on label 4 from where it left off from part1 on label 2, and is not just 'reset'.

    Can you give some feedback knowing this?

    Thanks
    0
  • Avatar
    Legacy Poster
    This sounds like a great advanced option to add under the Serialization tab of fields. For example "Increment by 1 every 1 label if x = y"

    This could be done via VB, again, if I could figure out how to edit a field's value using that.
    0
  • Avatar
    Domingo Rodriguez
    Moderator
    I've attached a label format sample which should do what you're after. Please note that:

    * Field1 (Part1, Part2) is a database field which comes from a text file which I've attached to this email and which you will need to copy to the "c:\Seagull" folder for testing purposes.

    * The label format contains two objects which are out of the label design area. Each object corresponds to a serial number. Each serial number is loaded (at OnAutoSelected event) and saved (at PrintEnd event)from / to a text file. This way, you will have a unique serial number for each type of Part Number (Part1, Part2).

    * For the text object which will be printed (serxxx)I've written a new VBScript line which, at the OnNewRecord event either shows serial number 1 or 2 depending on the type of part number which has been read from the database.

    Please take this sample as a test and modify for your own needs. If part number is not coming from the database, you could always prompt for it by creating a user prompt control. Let me know if you still have problems editing the field's value using this approach.
    0

Please sign in to leave a comment.