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 :
Microsoft Dynamics AX (Archived)

How to Create new number seq in standard form ( PurchParmTable form )

(0) ShareShare
ReportReport
Posted on by 219

Hi All ...

My Requirement is in *PurchParmTable*  i added one new customized field name *GoodsReceiptNumber* add assign the field to PurchEditLines form 

and this form i can open from PurchTableListPage and PurchTable 

45187.1.jpg

3060.2.jpg

how to bring the new number seq here for this field with out click new button .. i want to bring the number seq by opening the form and once its is generated against one purchase order again it wont bring number seq for same Purchid 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at

    Hi Kavin,

    You can implement coding on the initValue() method of the table where you placed this new field. To be able to know which number sequence to use, you have to change the system, so it can be setup on the parameters form.

    There are examples enough in the system to have a n extended data type included in the list of number sequences on the parameters form. Also there are examples how to draw a new number. If you want to cater for continuous number sequences, you have to take care of deleting/not inserting records as well.

  • kavinDevarajan Profile Picture
    219 on at

    Hi Andre

    Same as u mention i did in PurchParmTable- InitValue() enthod i created and assign the field .. issue i am facing is while i open the form i want to bring the number seq ..

  • André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at

    I'm wondering why you want to arrange a record data action on a form open method. Filling the field should not be done on opening the form.

    Do you currently face issues with the approach of using the initValue() method? If so, please elaborate on errors or wrong behavior.

  • Suggested answer
    kavinDevarajan Profile Picture
    219 on at

    Hi Andre

    Thanks Andre for your Reply .. Got Solution for this ..

    i got it by adding new method in form ( PurchEditLines ) and passing argument from Init() --- added this line // element.generateLECGRNNumber(parmId); //

    then calling in new method of form and in PurchParmTable - added number seq calling code ---

    ---------------------------------

    client server static NumberSequenceReference numLEC_ProductNumber()

    {

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

    }

    -------------------------------

    public void generateLECGRNNumber(ParmId  _parmId)

    {

       PurchParmTable           _PurchParmTable;

       NumberSeq                 numberSeq;

       LEC_ProductNumber   num;

       select forUpdate _PurchParmTable

           where _PurchParmTable.ParmId == _parmId;

       if(_PurchParmTable)

       {

           numberSeq = NumberSeq::newGetNum(PurchParmTable::numLEC_ProductNumber());

           num = numberSeq.num();

           ttsBegin;

           _PurchParmTable.LEC_GRN = num;

           _PurchParmTable.update();

           ttsCommit;

       }

    }

    ----------------------------------------------------

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans