Archive

Posts Tagged ‘Sequence in Microsoft Dynamics AX 2012’

Improved Transaction Numbering in Microsoft Dynamics AX 2012

September 18th, 2012 Ajit Srivastava No comments

Master data and transactions in Microsoft Dynamics AX can be automatically numbered by the system or can be manually numbered. The order of numbering – number of digits, preceding characters, automatic versus manual is determined by a system configuration called number sequences. A master data record or transaction record that requires a number sequence identifier is referred to as a reference.

The Microsoft Dynamics AX 2012 release came with a lot of improvements in different areas, including number sequences as per industry best practices. In the following article we are going to describe the number sequence features that are available out-of-the-box in Microsoft Dynamics AX 2012.

What is available out-of-box in Microsoft Dynamics AX 2012?

In Microsoft Dynamics AX 2012, when you create a new number sequence, the following options are available in scope – which regulate the scope of the created number sequence:

  • Shared
  • Company
  • Legal entity
  • Operating unit
  • Company and Fiscal calendar period
  • Legal entity and Fiscal calendar period

From the dropdown you can select any of the above selections. This creates an idea that we can share any number sequence as per our requirement, but this is not correct – we cannot have shared number sequences in Microsoft Dynamics AX 2012 as per our requirement. Some of the number sequences can be shared but others are not.

We can only share those number sequences across all companies for which we have available references for the area (e.g. product management) when the scope is selected as “Shared”. If there is no available reference for the area (e.g. Accounts Payable) when the scope is selected as “Shared”, we cannot share those number sequences.

Let us illustrate it in detail as below.

Create a number sequence and select scope as “Shared”.

Available number sequence scope parameters in Microsoft Dynamics AX 2012

Fig 1: Available number sequence scope parameters in Microsoft Dynamics AX 2012

After selecting the scope you need to add references to the created number sequence so that the number sequence is used for that reference. You need to select the area and corresponding reference so that the created number sequence can be used for that reference.

Available references in the product management area when a number sequence scope is “Shared”

Fig 2: Available references in the product management area when a number sequence scope is “Shared”

In the above example, if you select the “Product number” reference from the dropdown of the “Product Management” area of a shared number sequence, then the “Product number” is shared across all the companies.

When we select scope as “Shared” and select an area, you may find that there is no reference available in the dropdown selection for that area – which means that you cannot have a shared number sequence in that area.

 No available reference in the Accounts Payable area when a number sequence scope is “Shared”

Fig 3: No available reference in the Accounts Payable area when a number sequence scope is “Shared”

In the above example, as no reference is available for selection in the “Accounts Payable” area of a shared number sequence, no number sequence can be shared for the Accounts Payable area.

What is the requirement?

During the requirement gathering process of Microsoft Dynamics AX 2012 implementations, you understand that your customer needs all number sequences to be shared across all companies. For example, if they have three companies, they need a sales order number, purchase order number etc. to be shared across all three companies.

But seeing how standard Microsoft Dynamics AX number sequence functionality does not allow this, you may be worried.

The Solution

Don’t worry. There is simpler way to do that in Microsoft Dynamics AX 2012.

The following is a step-by-step guide how to do that:

  1. Remove record from NumberSequenceDataType and NumberSeqReference table.  We can delete data using table browser or using job as well. (This step is required if you have records already created for number sequence. Skip this if you do not create any records).
  2. If we want to share all the number sequence then we can change scope in method addParameterType for all.

    Change scope in method addParameterType for all

    Fig 4: Change scope in method addParameterType for all.

    Note: For example, to make a customer account number shared, we would have to comment below the marked line in loadModule method of NumberSeqModuleCustomer class.

    Comment marked line in loadModule method of NumberSeqModuleCustomer class to have a shared customer number

    Fig 5: Comment marked line in loadModule method of NumberSeqModuleCustomer class to have a shared customer number.

  3. Run the job for loading module (Below is the sample job, You need to run for all required modules)

    Job for loading modules

    Fig 6: Job for loading modules.

  4. Generate the number sequence using the standard way to generate a number sequence.
  5. Create your number sequence, and you will find the reference there.
  6. In NumberSeq class, wherever we have used “CreateDefaultScope()”, we would have to use “CreateGlobalScope”. (This would be required if we are sharing all the number sequences.)


    Fig 7: Change in NumberSeq class.

  7. When you changed the scope of Number Sequence from DataArea to Shared, you will not be able to see number sequences on a parameters form. We would have to change scope from “createDataAreaScope” to “createGlobalScope”.

    Change scope from “createDataAreaScope” to “createGlobalScope”on the parameter form

    Fig 8: Change scope from “createDataAreaScope” to “createGlobalScope”on the parameter form

Conclusion

Now all of the number sequences in Microsoft Dynamics AX 2012 are shared by the changes made in the above steps. You can use the same method module-wise when there is any sharing number sequence requirement for any specific module. If you have any questions about number sharing sequences in Microsoft Dynamics AX 2012, please email dynamics@ignify.com.

Ajit Srivastava is a Team Lead in the Microsoft Dynamics AX practice at Ignify. Ignify is a leading provider of Microsoft Dynamics ERP solutions to mid-market and Enterprise businesses. Ignify has been ranked as Microsoft Partner of the Year Winner in 2012, 2011 and 2010, and in the Microsoft Dynamics Inner Circle, Microsoft Dynamics Presidents Club in 2009. Ignify has offices and team members in Southern California, Northern California, Arizona, Tennessee, Illinois, Washington, Canada, Singapore, Malaysia, India, Philippines, and Jakarta.