10 Oct’17

D365 Business CentralProcedure to create custom No. Series in Dynamics NAV

Introduction:

No. Series is used to create records in Dynamics NAV with unique numbers. Unique numbers are assigned to data records automatically using No. Series. The format to be used for the No. Series should be set up initially once which consists of a combination of numbers and alphabets.

Pre-Requisite:

Microsoft Dynamics NAV

Purpose:

In this article, I will be demonstrating the procedure to create a custom No. Series in a custom table.

Procedure:

  1. Create a new field in Table 311 – Sales & Receivables Setup which will save the No. Series selected.

    Navigate to the properties of this field and in TableRelation property select Table 308 which is ‘No. Series’.

    Add the newly created field ‘CF_CreditNoteEntity’ to the Page 459 – Sales & Receivables Setup so that it is accessible to the user from the NAV windows or web client.

  2. Now create a new field ‘No. Series’ in a custom table with Data Type ‘Code’.

    Navigate to the properties of the No. Series field and in TableRelation property select Table 308 which is ‘No. Series’.

    Note: ‘No.’ field is the primary key of the custom table which will save the unique No. Series.

  3. Create two new variables in C/AL globals in the custom table.
    a. SalesSetup of DataType ‘Record’ and Subtype ‘Sales & Receivables Setup’ which is Table 311.
    b. NoSeriesMgt of DataType ‘Codeunit’ and Subtype ‘NoSeriesManagement’ which is Codeunit 396.
  4. In OnInsert() trigger of the table add the following code:
  5. In OnValidate() trigger of the primary key field which will save the unique No. Series add the following code. In this scenario, I have added it to the OnValidate() trigger of ‘No.’
  6. Go to ‘No. Series’ which is Table 308 and create a new entry for the No. Series to be used.

    To generate ‘No. Series’ automatically you need to select ‘Default Nos.’ checkbox. If you also want the field to support manual nos. then you should select the checkbox ‘Manual Nos’.

    The ‘Last No. Used’ field gets updated automatically when a record is created and the unique No. Series is inserted in the table.

  7. Navigate to Sales & Receivables Setup which is Page 459 and select the No. Series for the newly created field in step 1 from the drop down list.                                                                                                                  
  8. Hence, automatically when you create a new record, the No. Series will get inserted and a unique record will be created.

Conclusion:

Thus following this procedure, a custom ‘No. Series’ can be created for a custom table with any combination of alphabets and numbers which will create unique records.

Written by

Team Member

CloudFronts

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more