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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Load new NumberSequence error : the datatypeid field is mandatory

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm creating new number sequence, it was succeeded but then import the EDT and the classes made it into a new environment. After successfully Build with no error, when trying to run the LoadModule class, it always give me an error :

pastedimage1666319519961v1.png

Spend sometime to check what I probably missed when import but seems (in my knowledge so far) all is imported. May I get advice what's wrong ?

Here are the objects which I believe all there is to create new Number Sequence : 

1. Create EDT : My_StatetNum

2. Create CoC, and since I want to put it into AR Parameters, extend NumberSeqModuleCustomer

[ExtensionOf(classStr(NumberSeqModuleCustomer))]
final class My_NumberSeqModuleCust_Extension
{

    protected void loadModule()
    {
        next loadModule();
        NumberSeqDatatype datatypeExtend = NumberSeqDatatype::construct();

        /* Setup state numbers */
        datatypeExtend.parmDatatypeId(extendedtypenum(My_StateNumber));
        datatypeExtend.parmReferenceHelp(literalstr("Unique key for state."));
        datatypeExtend.parmWizardIsContinuous(false);
        datatypeExtend.parmWizardfetchAheadQty(5);
        datatypeExtend.parmWizardIsManual(NoYes::No);
        datatypeExtend.parmWizardIsChangeDownAllowed(NoYes::No);
        datatypeExtend.parmWizardIsChangeUpAllowed(NoYes::No);
        datatypeExtend.parmWizardHighest(999999);
        datatypeExtend.parmSortField(10000);
        datatypeExtend.addParameterType(NumberSeqParameterType::DataArea, true, false);
        this.create(datatypeExtend);
    }

}

3. Create CoC on CustParameters table

[ExtensionOf(tableStr(CustParameters))]
final class My_CustParameters_Extension
{
     
    client server static NumberSequenceReference numRef_My_StateNumber()
    {
        return NumberSeqReference::findReference(extendedTypeNum(My_StateNumber));
    }

}

4. Create runable class for LoadModule

internal final class My_LoadNumberSeq
{
    /// 
    /// 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.
    /// 
    /// The specified arguments.
    public static void main(Args _args)
    {
        
        NumberSeqModuleCustomer numberSeqModCust = new NumberSeqModuleCustomer();
        
        numberSeqModCust.load();
    }

}

4. run this in browser

I tried to debug this runable class, and it seems the code not calling numberSeqModCust.load(); When I pressed Step into, it doesn't step in and the error raise.

Please help.

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi VoltesDev,

    If the COC doesn't work try extending the class like below.

    class My_NumberSeqModuleCustExtension extends NumberSeqModuleCustomer
    {
    
        protected void loadModule_Extension()
        {
            NumberSeqDatatype datatypeExtend = NumberSeqDatatype::construct();
    
            /* Setup state numbers */
            datatypeExtend.parmDatatypeId(extendedtypenum(My_StateNumber));
            datatypeExtend.parmReferenceHelp(literalstr("Unique key for state."));
            datatypeExtend.parmWizardIsContinuous(false);
            datatypeExtend.parmWizardfetchAheadQty(5);
            datatypeExtend.parmWizardIsManual(NoYes::No);
            datatypeExtend.parmWizardIsChangeDownAllowed(NoYes::No);
            datatypeExtend.parmWizardIsChangeUpAllowed(NoYes::No);
            datatypeExtend.parmWizardHighest(999999);
            datatypeExtend.parmSortField(10000);
            datatypeExtend.addParameterType(NumberSeqParameterType::DataArea, true, false);
            this.create(datatypeExtend);
        }
    
    }

    Now create a runnable class and add below code.

    internal final class My_LoadNumberSeq
    {
        /// 
        /// 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.
        /// 
        /// The specified arguments.
        public static void main(Args _args)
        {
            
            NumberSeqModuleCustomer numberSeqModCust = new NumberSeqModuleCustomer();
            
            numberSeqModCust.loadModule_Extension();
        }
    
    }

    Thanks,

    Girish S.

  • VoltesDev Profile Picture
    on at

    Hi,

    Tried as per your advice, and strangely I'm hit this odd error ->

    Severity Code Description Project File Line Suppression State
    Error ClassDoesNotContainMethod: Class 'NumberSeqModuleCustomer' does not contain a definition for method 'loadModule_Extension' and no extension method 'loadModule_Extension' accepting a first argument of type 'NumberSeqModuleCustomer' is found on any extension class. MyDevelopment (USR) [MYDev] 

    It is highlighting the main() in LoadModule runable class

    pastedimage1666337905476v1.png

  • GirishS Profile Picture
    27,827 Moderator on at

    Can you  show me the screenshot of the loadModule_Extension method class.

    Thanks,

    Girish S.

  • VoltesDev Profile Picture
    on at

    Hi Girish,

    Here it is. Thanks.

    pastedimage1666338236792v2.png

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    Oh sorry its my mistake. You need to create object for your class not standard class. Like below.

    internal final class My_LoadNumberSeq
    {
        /// 
        /// 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.
        /// 
        /// The specified arguments.
        public static void main(Args _args)
        {
            
            MyNumberSeqCustExtension numberSeqModCust = new MyNumberSeqCustExtension();
            
            numberSeqModCust.loadModule_Extension();
        }
    
    }

    Thanks,

    Girish S.

  • VoltesDev Profile Picture
    on at

    Hi Girish,

    Much thanks. I have to remove the "protected" in the loadmodule_extension() since it is makes error. It's finally works!

    I'm not sure why had to be this way, though. Since the CoC is works in my 1st environment.

    Anyway thank you very much for your help.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 302 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 183 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 120 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans