Acumatica has flexible numbering sequences that allow us to create prefixes, separate numbering sets and basically serves well when there is a uniformity for the numbering for a given screen.
For example, when we issue specific number for specific month or year we can always create separate numbering sets with starting date from effective date for that month or year and problem will be solved.
Here is the example of numbering set for AR payment screen, where each month system will generate numbers for Payment Reference ID starting from predefined prefix and month code:
When we look at AR Setup screen, this numbering sequence ID is specified at Payment Numbering Sequence:
But this example is too simple. What if we need to use special numbering under specific condition. For example, when you do synchronization with external system, Oracle for example, it may be that you are getting Payment ID numbers from there, and need to override the Auto numbering sequence that is in force at your setup. Another words, from Oracle you can get number starting from IV instead of RV and the number itself should be from Oracle, not generated by Acumatica.
To solve it, we can add Numbering Sequence as a custom field to our setup screen. Just add a field to AR Setup, and make it same as other payment numbering sequence fields:
Here is the customization code behind it:
<Field FieldName="UsrARImportID" TypeName="string" MapDbTable="ARSetup" TextAttributes="#CDATA">
<CDATA name="TextAttributes"><![CDATA[[PXDBString(10, IsKey=false, BqlTable=typeof(PX.Objects.AR.ARSetup), IsFixed=false, IsUnicode=true)]
[PXUIField(DisplayName="Import Numbering Sequence")]]]></CDATA>
And then we should create a new Numbering Sequence called ARIMPORT. Here is the hint, if we need number to come automatically from Acumatica, then we should feel it with something, but if number is provided from outside, say MANUALLY, then we can just create the ID ARIMPORT, leaving content blank:
Please take note of this.IsImport it changes to True when we do data import from Oracle.
Next we should tell the screen if this is Data Import process, not to use standard numbering sequence but to look at newly defined ARImport one:
So now we can decide what do we do, we manually populate the number from our Import file or call autonumbering process from ARIMPORT predefined sequence.
But you can use commented code to call AutoNumberAttribute process to generate the number based on ARIMPORT Numbering Sequence content.
All the best,