Today I want to share with you how I implemented autonumbering feature in acumatica for page CA304000.
My task originally was the following: add autonumbering feature to the "Document Ref" field with following rules:
a. step of incrementing is 1
b. length of field should be six characters. For example 000001, 000002, ... , 000223, 001024, ..., and so on
First of all I want to state that my way of adding much simpler then "canonical" ( according to acumatica manuals ) way of adding autonumbering. If you wish to use standard way you should accomplish so many steps that I should admit that my brain wasn't able to boil them in one project.
Instead of this I used the following steps.
1. In the page CA304000 I found class, which provides data for the page. It looks like this:
2. Created extention of class in the following way:
3. Located method which returns list of records for the page CA304000, it was the method: CAAdjRecords.
4. According to rules of acumatica, if I want to modify behaviour of method CAAdjRecords I should implement method caadjrecords.
6. Implemented method which digs in DB, and returns needed number in string format:
7. Used GetExtRefNbr in the method caadjrecords in the following way:
8. Enjoyed results:
the field Document Ref.: was inserted automatically.