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 :
Finance | Project Operations, Human Resources, ...
Answered

Issue with Deploying Number Sequence

(1) ShareShare
ReportReport
Posted on by 405

Hello everyone,

 

I am facing a strange issue regarding the Number Sequence.

I followed steps from the internet to create a Number Sequence, and I also reviewed some scenarios that the system provides for generating a Number Sequence.

 

I wrote and executed this code, and it worked fine in my development environment:

 
public class EMNumberSeqModule extends NumberSeqApplicationModule
{
    [SubscribesTo(classstr(NumberSeqGlobal),delegatestr(NumberSeqGlobal, buildModulesMapDelegate))]
    public static void buildModulesMapSubsciber(Map numberSeqModuleNamesMap)
    {
        NumberSeqGlobal::addModuleToMap(classnum(EMNumberSeqModule), numberSeqModuleNamesMap);
    }

    public NumberSeqModule numberSeqModule()
    {
        return NumberSeqModule::Vend;
    }

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

        datatype.parmDatatypeId(extendedTypeNum(DynamicsDeductionNum));
        datatype.parmReferenceHelp(literalStr("Unique key used for the Deduction."));
        datatype.parmWizardIsContinuous(false);
        datatype.parmWizardIsManual(NoYes::No);
        datatype.parmWizardFetchAheadQty(10);
        datatype.parmWizardIsChangeDownAllowed(NoYes::No);
        datatype.parmWizardIsChangeUpAllowed(NoYes::No);
        datatype.parmSortField(1);
        datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
        this.create(datatype);

        datatype = NumberSeqDatatype::construct();
        datatype.parmDatatypeId(extendedTypeNum(DynamicsRequestNum));
        datatype.parmReferenceHelp(literalStr("Unique key used for the Loan."));
        datatype.parmWizardIsContinuous(false);
        datatype.parmWizardIsManual(NoYes::No);
        datatype.parmWizardFetchAheadQty(10);
        datatype.parmWizardIsChangeDownAllowed(NoYes::No);
        datatype.parmWizardIsChangeUpAllowed(NoYes::No);
        datatype.parmSortField(2);
        datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
        this.create(datatype);
    }
}
 

However, when I create a package and deploy it to the UAT environment, I find that only one Number Sequence is added, while the other is ignored.

 

I tried searching for a solution but couldn't find anything useful.

 

Here are some screenshots comparing the development environment with the UAT environment:

DEV:

 

UAT:

Categories:
I have the same question (0)
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    The issue likely stems from caching or data synchronization problems in the UAT environment. Here’s how you can fix it:

    Solution Steps:

    1. Check if Both Number Sequences Exist in UAT
      • Go to Organization administration > Number sequences > Number sequences
      • Verify if both DynamicsDeductionNum and DynamicsRequestNum are present.
      • If missing, proceed with the steps below.
    2. Manually Sync Number Sequences
      • Run the following SQL query in the UAT environment to check if both Number Sequence records exist in the NumberSeqDatatype table:
    sql
    SELECT * FROM NumberSeqDatatype WHERE DataTypeId IN ('DynamicsDeductionNum', 'DynamicsRequestNum')
    
    If missing, try running the "Generate" function in Organization administration > Number sequences > Generate.
    1. Force a Full Synchronization
      • Run DB Synchronization from Visual Studio or Lifecycle Services (LCS).
      • Alternatively, execute the following job in Dynamics 365 FO:
    x++
    NumberSeqDatatype::loadModule();
    1. Deploy Again with Full Compilation
      • Ensure the model containing your EMNumberSeqModule is included in your deployment package.
      • In Visual Studio, rebuild the project and deploy the package again, ensuring no errors occur.
      • Run a full compile & sync in UAT.

    Final Check:

    After following these steps, go back to Number sequences in UAT and confirm that both sequences appear correctly.
     
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at
    Hi Ali,

    You can read my blog which provides the solution for missing number sequence references: What to do when new number sequence references on parameter forms are missing? - Dynamicspedia
  • Ali AbdAlNasser Profile Picture
    405 on at
    I followed the steps you mentioned, but I didn't get any results. Even after syncing, the issue was not resolved
  • Ali AbdAlNasser Profile Picture
    405 on at
    Hello, I followed the steps in your blog, but I couldn't find my numeric sequence. I'm worried that the issue might be in the code I wrote. So if you find any errors in the code I posted in the question above, please let me know
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    Since the issue persists even after synchronization, let's go deeper into possible causes and solutions.
    Potential Causes & Solutions
    1. Ensure the Module is Registered in UAT
    • Run the following X++ job in UAT to confirm that your module is properly registered:
    x++
    CopyEdit
    Map modulesMap = NumberSeqGlobal::buildModulesMap();
    info(modulesMap.lookup(classnum(EMNumberSeqModule)));
    • If it returns empty, your module is not being recognized. Ensure your package deployment includes it.
    2. Manually Reload Number Sequence Module in UAT
    If the module is not loading, try forcing it manually:
    x++
    CopyEdit
    NumberSeqGlobal::addModuleToMap(classnum(EMNumberSeqModule), NumberSeqGlobal::buildModulesMap());
    NumberSeqDatatype::loadModule();
    • Then, regenerate number sequences from Organization administration > Number sequences > Generate.
    3. Check if the Second Number Sequence is Overwritten
    • Your parmSortField(2); might be causing an issue where only one sequence is being recognized.
    • Try changing the order of sequence creation in loadModule() and redeploy.
    4. Rebuild & Deploy with Full Clean
    • Delete the package from UAT.
    • Rebuild your model in Visual Studio with "Clean Solution."
    • Deploy again ensuring the model is included.
    Final Check
    After redeploying, run:
    x++
    CopyEdit
    NumberSeqDatatype::findByDatatype(extendedTypeNum(DynamicsRequestNum));
    If it returns empty, the sequence is not created in UAT, indicating a deployment issue. If it exists, but not in UI, try refreshing caches:
    x++
    CopyEdit
    SysFlushAOD::main();
    SysDictClass::rebuild();
  • Suggested answer
    Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at
    You execute the loadModule() on DEV using a runnable class I presume. 
    Did you try running the same Runnable class on the UAT?
     
    If you do not have that class attached to a menu item, you can use the SysClassRunner : 
     

    https://<D365URL> /?cmp=<YourCompanyName>&mi=SysClassRunner&cls=<YourRunnableClassName>

  • Ali AbdAlNasser Profile Picture
    405 on at

    Hello everyone,

    Thank you for contributing to helping me find the solution. However, it seems that I have found the solution one way or another. After carefully examining André Arnaud's blog, I discovered that he calls the function responsible for loading the Number Sequence inside the Parameters table. So, I looked into Microsoft's VendParameters table and found that they call the Number Sequence loading function in case it is not loaded automatically. I followed the same steps, and the process was successful

    I sincerely appreciate your help.

     

    Ali AbdAlNasser

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans