Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Number sequence without using class

(0) ShareShare
ReportReport
Posted on by 560

Hi,

Please suggest on how to create a number sequence without using any class in ax 2012 r3.

Please advice.

Regards,

AXTechie 2120

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 231,407 Most Valuable Professional on at
    RE: Number sequence without using class

    No, you can't. Object-oriented programming is based on classes and their methods, not just some standalone procedures.

    What are you trying to achieve by not using classes? Maybe we can tell you how to achieve that in way that actually is possible.

  • AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: Number sequence without using class

    Hi martin,

    For reusing the unused numbers in number sequence  i used the below code in the delete method,

    NumberSeq::releaseNumber(BTC_empl::numseqid().NumberSequenceId,numseqid);

    but can we reuse the unused numbers in number sequence with replacing the above code with some code that does not use any methods of any class.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 231,407 Most Valuable Professional on at
    RE: Number sequence without using class

    It's also covered by the white paper I gave you; please look at it.

    You'll notice the following code in delete() method of the form datasource:

    public void delete()
    {
        element.numberSeqFormHandler().formMethodDataSourceDelete();
        super();
    }

    Forget about not using classes; it's not possible. Maybe you won't use them directly, but you can't avoid using classes.

  • AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: Number sequence without using class

    Thanks for  your reply,

    But what i Want is if the number sequence is deleted i want to make that deleted number reusable, and i know that we can do it by use the class  NUMBERSEQ and ReleaseNumber Method in that class.

    Now what i want is the I dont want to use that class,without using that class can we  do the reusing of number sequence which are deleted.

    Regards,

    AX  Techie 2120

  • Suggested answer
    Raheel-Khan Profile Picture
    Raheel-Khan 1,371 on at
    RE: Number sequence without using class

    Read point# 19 from the document which I given you as a link in above reply.

    www.dynamics101.com/creating-custom-number-sequences-microsoft-dynamics-ax-2012

  • AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: Number sequence without using class

    Hi martin,

    THanks for you reply,

    I just wrote a job to create a number sequence and i have inserted that number sequence in the table.

    Now i have created a  two methods in the table like this,

    client server static NumberSequenceReference   numseqid()

    {

       return   NumberSeqReference::findReference(extendedTypeNum(Numseqid2));

    }

    and then

    public void initValue()

    {

       NumberSeq    numberseq;

       super();

       numberseq  = NumberSeq::newGetNum(BTC_empl::numseqid());

       this.NumSeq = numberseq.num();

    }

    Everything is good upto now,but whenever I open the table or form and press Ctrl+N its  says that the Number sequence reference is missing.

    I know how to add a reference for a number sequence,but how can i do that in the Job where i inserted the number sequence into the numbersequence Table.

    Please advice.

    AXTechie 2120

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 231,407 Most Valuable Professional on at
    RE: Number sequence without using class

    What exactly are you doing? This sounds more like you're trying to assign a number from a sequence and the question not about creating a new number sequence.

    If it's the case, find Forms example section in Using the Enhanced Number Sequence Framework (White paper); it'll tell you how to use NumberSeqFormHandler class in a form.

  • AXTechie2120 Profile Picture
    AXTechie2120 560 on at
    RE: Number sequence without using class

    Hi guys,

    Thank you for your replies.

    I have already created a number sequence using a job and that number sequence is insereted in the table.

    Now i want to use that number sequence in my form.

    Please suggest how to achieve this.

    Regards,

    AXTechie 2120

  • Suggested answer
    Raheel-Khan Profile Picture
    Raheel-Khan 1,371 on at
    RE: Number sequence without using class

    You can also create a custom number sequence like mentioned below link e.g. for customer group:

    www.dynamics101.com/creating-custom-number-sequences-microsoft-dynamics-ax-2012

  • Raheel-Khan Profile Picture
    Raheel-Khan 1,371 on at
    RE: Number sequence without using class

    Hi AXTechie2120,

    Trust you fine!

    Can you please clarify you question what you want to achieve, is you talking about a new number sequence which you want to configure? Please specify the number sequence which you want to create!

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans