1. Create a custom record with single integer field - this will serve as the storage of the reference number with starting value of 1.
2. On beforesubmit, get this value and set it to the custom field within the transaction record
3. After record submit, update the integer field by incrementing the value to 1