Autonumber on demand

Autonumber on demand

I have a field that I want to use an autonumber for....but not all the time.

USE CASE:
In the cases module I created an option to allow the customer to return defective product.  When this is authorized (I have a checkbox), a Return Material Authorization is issued.  I want this RMA number to be sequenced and autogenerated to save time looking for the last RMA number issued.

Any ideas on how to include this field but prevent it from issuing a number unless the a return is authorized, or do I need a function to do this?