Custom Number Sequence need to display in my new Form

This question is not answered

I searched all the blogs and tried several steps given by many developers but could not get the number sequence generating in my form. 

My Requirement is :

I have created a table with 14 fields and one of the field is RFI Number.  I need to generate my own sequence number for this RFI Number field and that needs to be associated to my New Form.  So that every time I insert a new record from form, new sequence number should be generated and saved in database.

I am new to DAX so I am not sure about the parameter table and how to create that.  May be this is where I am lacking and so I am not able to generate the sequence numbers.  Please provide the exact and complete steps.

Thanks in advance!!

All Replies
  • this helped me setting up custom number sequences:

    www.axaptapedia.com/.../Number_sequences

    Instead of creating a new parameters form you can use existing ones ;)

  • Have you already consulted the documentation?

  • Yeah I did gone through the documentation given by Microsoft, but its not clear....and also followed the steps given in some of the blogs.....I lost when they say to add code for your parameter table...not sure how to create them and the use of these tables.....

    Could you please share if you have any docs or some other info on this Number Sequence.

  • For example: You want to add the numsequence to the InventParameters.

    In AOT go to the "InventParameters" table and create a new method that looks like this:

    server static NumberSequenceReference numRefTest()
    {
        return NumberSeqReference::findReference(typeid2ExtendedTypeId(typeid(<Extended DataType>)));
    }

     

    numRefTest can be anything that you want, make it clear for what numsequence it is.

    <Extended Datatype> is your extended datatype for the numsequence you want to create. For example lets say i have an extended datatype named "Cus_PackageID"

    witch extends String then you put "Cus_PackageId" where <Extended DataType> is without quotes.

     

    You can go to the inventparameters form to setup the numsequence to look like "PACK#######" so that every generated id  starts with PACK (in this example).

    To generate a new number just call:

    (table.packageId) = NumberSeq::newGetNum(InventParameters::numRefTest()).num();

    where table.packageid is the field of a table where you want this number to be.

  • oh if you want to see your number sequencei in inventparameters also add it to the 'loadmodule' method of the class: NumberSeqReference_Inventory

  • Hello Roderik, I need to generate a number sequence on a new module, it cannot be part of any other existing module.

    I tried all the solutions provided by many people on the internet.  But I could not succeed with any of the solution.

    Does anyone help me with complete and step by step process for generating Number sequence in a new module.

    I mean, creating a new module, creating a parameter table and form....and other classes and methods and their purpose...

    I am surprised that there is nothing available with all these details.  So I request if someone could help me.  Please this is very urgent...

  • Hi Martin, Do you have any white paper kind of thing to follow .....

  • Rather then requiring some other documentation than others use, it would be better to mention what parts of the existing documentation are not clear to you. We can't fix a problem if we don't know what it is.

  • 1. Creating a New Module means what

    2. Why create parameter table and form are required and how to create them and their properties etc., to make a complete module

    3. Steps to follow for creating a Custom Number sequence (with code)

    4. Consuming that in our Custom Form. (with code)

    This is what I am looking for.

    Thanks in advance!!

  • 1.and 2.: Creating a new module requires many steps - each module has it's own menu, structure or security keys, parameters etc. Regarding number sequences, you need a new element in NumberSeqModule enum, a new NumberSeqModule* (or NumberSeqReference_*) class, add it to NumberSeqReference.moduleList (AX2009 and older), provide a GUI (normally as the last tab in Parameters form) etc. Consult the documentation and other modules for details.

    3., 4.: What exactly is not clear to you? Even the code is in the documentation.

  • my requirement is just to create a Number Sequence for my Form ... and I dont think we need a Menu to achieve this.  I just learnt that we need a seperate module to have our own customized Number Sequence to be consumed in our own form.  

    So I was looking for complete documentation on creating a Module.  I think it would be better to share the link that you are reffering to, so that I will try and ask you the questions based on that documentation.

    also provide links for generating and consuming Number Sequence.

    Thanks

  • You wrote: "I need to generate a number sequence on a new module, it cannot be part of any other existing module." Now you say the opposite.

    So what exactly do you need? Let's say:

    • You need a new number sequence, configurable as a part of an existing module
    • You have a custom table and form and you want the number sequence to be used automatically when you create a record of the table in the form

    Is it so?

    If yes, you'll need sections Making Number Sequence Data Types and Using Number Sequences in an Application from the documentation (linked above).