jjfm90 Posted January 12, 2017 Share Posted January 12, 2017 I am trying to find a way to set an auto enter serial number for a field, but to do it by customer. When I have customer "A" they start at "1", and customer "B" starts at "1". As I add assets to each of them, only their group of serial numbers increase. Table 1, contacts_table Table 2, asset_lots (groups of assets base on customer) Table 3, line_items (each item must have a new generated serial number, specific to the lot, and these are tied back to the order, and customer) I have all of the tables set with relationships etc, I just can't figure out how to set a unique serial number grouping by customer. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Steve Martino Posted January 13, 2017 Share Posted January 13, 2017 This may be easier to parse out but can you give a concrete example of what is in the fields and the output you would like to see? Link to comment Share on other sites More sharing options...
AHunter3 Posted January 13, 2017 Share Posted January 13, 2017 Table 4: Customers — contains customer name, customer ID, and LastSerialNumber Each time you make a new record in whatever table you're wanting separate serials by customer, run a script that updates LastSerialNumber by 1 and then populates the local record with that value. Under the hood, make sure you don't use this field in relationships; use a real serial number that is completely unique and doesn't reoccur across different customers. Link to comment Share on other sites More sharing options...
Recommended Posts