web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Custom Number Sequence Number sequences menu

(4) ShareShare
ReportReport
Posted on by 212

Hello everyone,

I'm currently working on a customization in Dynamics 365 F&O where I need to automatically generate a Work Order ID for my custom table MET_ToolingRoomProdTable. I created a custom number sequence and associated it with the field ToolingWOID, which uses the extended data type MET_SparePartWOID.

To implement this, I followed this tutorial step-by-step:
https://dynamics365musings.com/develop-a-d365-number-sequence/

What I did :
  1. I created a custom number sequence module by extending NumberSeqModule base enum : MET_NumSeq
  2. Then, I copy/paste and modify the code to this :
public class MET_SparePartWOIdNumSeq extends NumberSeqApplicationModule
{



    [SubscribesTo(classStr(NumberSeqGlobal),delegateStr(NumberSeqGlobal,buildModulesMapDelegate))]
    public static void NumberSeqGlobal_MET_buildModulesMapDelegate(Map numberSeqModuleNamesMap)
    {
        NumberSeqGlobal::addModuleToMap(classNum(MET_SparePartWOIdNumSeq), numberSeqModuleNamesMap) ;
    }

    protected void loadModule()
    {
        NumberSeqDatatype dataType = NumberSeqDatatype::construct() ;

        dataType.parmDatatypeId(extendedTypeNum(MET_SparePartWOID)) ;
        dataType.parmReferenceHelp(literalStr("Unique key for spare parts WO ID")) ;
        dataType.parmWizardIsManual(NoYes::No) ;
        dataType.parmWizardIsChangeDownAllowed(NoYes::No) ;
        dataType.parmWizardIsChangeUpAllowed(NoYes::No) ;
        dataType.parmWizardHighest(9999999) ;
        dataType.parmSortField(1) ;

        dataType.addParameterType(NumberSeqParameterType::DataArea, true, false) ;
        this.create(dataType) ;
    }

    public NumberSeqModule numberSeqModule()
    {
        NumberSeqModule numberSeqModule ;
        numberSeqModule = numberSeqModule::MET_NumSeq ;
        return numberSeqModule ;
    }

}
        3. Then, this code :
class MET_SParePartWOIDNumSeqLoad
{
    /// <summary>
    /// Class entry point. The system will call this method when a designated menu 
    /// is selected or when execution starts and this class is set as the startup class.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        MET_SparePartWOIdNumSeq MET_SparePartWOIdNumSeq = new MET_SparePartWOIdNumSeq();
        MET_SparePartWOIdNumSeq.load();
    }

}
 
But, after building and synchronizing the solution (with no errors), the number sequence does not appear in the Number sequences menu
  • Am I missing a step in the registration or setup of the number sequence module?
  • Any ideas why my sequence doesn’t show up despite a successful build?
 

Thanks in advance for your help!

Categories:
I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at
    Did you run your Runnable class/job , which has main method? You can run it using a menu item or using the  following pattern or URL
    https://YourDynamics365URL/?cmp=YourCompanyIDLikeUSMF&mi=SysClassRunner&cls=YourRunnableClassName
    https://YourDynamics365URL/?cmp=YourCompanyIDLikeUSMF&mi=SysClassRunner&cls=MET_SParePartWOIDNumSeqLoad
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,803 Super User 2026 Season 1 on at
    Ho @JeanB,
     
    You need to run your "MET_SParePartWOIDNumSeqLoad" class to load the sequence number.
    Then you must generate this seq number.
     
    Best regards,
  • Suggested answer
    salman ahmad Profile Picture
    272 on at
    Hi dear please create the Reference in Number sequence or as someone mentioned below you can use the class method as well or just generate the Number sequence from wizard.
  • JeanB Profile Picture
    212 on at
    Hello everyone, thanks you a lot for your response ! This worked to me :
    https://YourDynamics365URL/?cmp=YourCompanyIDLikeUSMF&mi=SysClassRunner&cls=MET_SParePartWOIDNumSeqLoad
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    305,301 Super User 2026 Season 1 on at
    Hi JeanB,
     
    You already have a solution which is great. Note that you can also solve the issue from the user interface. I wrote a blog about it in the past: What to do when new number sequence references on parameter forms are missing? - Dynamicspedia

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 587

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 552 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 542 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans