Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:42:24+00:00 2026-06-15T23:42:24+00:00

I have a custom utility which uses a custom table in AX 2012 AOT,

  • 0

I have a custom utility which uses a custom table in AX 2012 AOT, I want to have an identity field for my table and someone tell me I can use number sequences for this, and can map a number sequence to my table so it can get a new unique id at the time of row insert, when I try to generate number sequence it asks me AREA and module information, since i want this for my custom table and utility which is working outside the dynamics ax 2012 using .net business connector, I am unable to figure out what to input the wizard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:42:25+00:00Added an answer on June 15, 2026 at 11:42 pm

    You have probably seen the method of using NumberSeqModule enum and adding a custom module enum value to it. Then you would normally create a class that extends the NumberSeqApplicationModule class and then load the numbersequences linked to the data types using number sequence references.

    Though this is the ‘best practice way’, it is a bit of overkill for what you would want to do now. So here is what you can do:

    You could just overwrite the insert method of the table you are using. And the you could use the newGetNumFromCode constructor on the NumberSeq class.

    public static NumberSeq newGetNumFromCode(
        NumberSequenceCode  _numberSequenceCode,
        NumberSeqScope      _scope = NumberSeqScopeFactory::createDefaultScope(),
        boolean             _makeDecisionLater           = false,
        boolean             _dontThrowOnMissingRefSetUp  = false,
        SysLastValue        _nextNumSeq = null,
        boolean             _fillNextNumSeq = false)
    {
        return NumberSeq::newGetNumFromId(
                NumberSequenceTable::findByNaturalKey(_numberSequenceCode, _scope.getId()).RecId,
                _makeDecisionLater,
                _dontThrowOnMissingRefSetUp,
                _nextNumSeq,
                _fillNextNumSeq);
    }
    

    So now to use this, you just have to create a new numbersequence within Dynamics Ax (Organization administration | Number Sequences | Number Sequences) and remember the number sequence code.

    Then on the insert method of your table you can do the following: (the example is taken from the contact person table)

    if (!this.ContactPersonId)
    {
        this.ContactPersonId = NumberSeq::newGetNum(CompanyInfo::numRefContactPersonId()).num();
    }
    

    That should make sure that when a record is inserted, you will also fill the ID.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to write an utility function that can convert my custom data
I want to use custom delegate in my search tab. I have never used
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have custom event that has several different subscribers who will all use the
I have custom component that I can place in my layout file (XML) for
we're building a cross-platform utility which must have a small footprint. We've been pulling
I'm building a custom page caching utility that uses a syntax like {Substitution:GetNonCachedData} to
I have a set of views I want to always use together. An example
I have a flex library project, assume this project as basic utility which will
Is there any kind of predefined adapter or custom utility that can help me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.