Number sequence is a feature in Microsoft Dynamics 365 Finance and Operations that enables the system to generate a unique identifier for records automatically. It lets you to define a specific format for the identifier, tailored to the type of record being created. This feature is particularly useful in situations where a unique value is needed but no predefined identifier is available.
Number sequences in Dynamics 365 Finance and Operations play a crucial role in organizing and categorizing transactions. They help maintain accurate records, streamline data retrieval, and improve overall system efficiency.
In this blog, we’ll explore what number sequences are, how they enhance transaction management, and provide a step-by-step guide to setting them up in Dynamics 365 Finance and Operations.
What are number sequences?
Number sequences in Dynamics 365 Finance and Operations are unique identifiers assigned to records such as invoices, purchase orders, and customers. They help organize and categorize transactions, ensuring consistency and easy retrieval of data. By defining number sequences, businesses can streamline record-keeping and maintain structured, traceable information across the system.
Example of a number sequence
For example, when dealing with student IDs, educational institutions may have a predefined numbering system for identifying students. However, in many other cases, such as when creating new student records or enrollments, it’s more efficient to have the system generate a unique identifier. Using number sequences, Dynamics 365 Finance and Operations saves time and ensures consistency as the system automatically provides a unique student ID whenever one is needed, eliminating the need for manual input.
Disclaimer: This is just an illustrative example for better understanding. Microsoft Dynamics 365 does not provide any specific module or form for educational institutions, and this example does not imply that such feature exists in the platform.
Getting started with number sequence in Dynamics 365 Finance and Operations
To develop a number sequence in Microsoft Dynamics 365 F&O, several key steps must be followed. Below is a high-level overview of the necessary steps, followed by a more detailed explanation of each one.
- First, identify the field, table, and form that will use the number sequence.
- Next, create a class that extends the NumberSeqApplicationModule. This class will include the code required to add a row to the ‘Number sequence’ tab on the parameters form. The ‘number sequence reference’ allows the user to specify which ‘number sequence code’ should be used for the selected field.
- Then, execute a runnable class (job) to process the class created in the previous step. This action will generate the ‘number sequence reference’ row.
- After this, assign a ‘number sequence code’ to the ‘number sequence reference,’ defining the format of the number sequence.
- Finally, override the ‘create’ method in the data source of the form that will utilize the number sequence. This method should include code to fetch a new number from the assigned number sequence each time a new record is created.
Now let’s look into each step in detail.
Step 1: Identify the field
First, we need to determine which field on a table should be assigned to use a number sequence.
Suppose the table contains two fields: StudentId and Description. The StudentId field has the Extended Data Type (EDT) property set to ‘StudentId.’
Extended Data Types (EDTs) are separate objects created in Visual Studio that define various properties, such as string size and label. Any field on a table that uses a specific EDT will automatically inherit these properties. In this case, the StudentId field inherits the properties defined in the ‘StudentId’ EDT.