Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

when we delete a purchase order?

Posted on by 1,055

Suppose say I have purchase orders created with numbers till REL-00167. I created a new PO and was given a number REL-00168 by AX. I have deleted this when its in draft status. When I'm creating a new PO why is it creating with a number REL-00169? It should be in a sequence right? What settings do I need to change if this needs to be in a sequence? What should I change so that I'll get the new PO assigned a number with REL-00168?

*This post is locked for comments

  • CHANDRA1989 Profile Picture
    CHANDRA1989 1,055 on at
    RE: when we delete a purchase order?

    Hi Andre,

    Few Days back we had a problem in confirming and printing the PO's. This is because someone has enabled the change management.  This was resolved yesterday. For time being our users have edited the PDF doc manually using PDF editor on the system. So now the issue is to have the same number in AX.

    Is this really possible?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: when we delete a purchase order?

    There can be only one source which will provide Purchase order numbers. If the users edit a pdf document, it certainly will break the logic used in AX.

    What kind of problem are you referring to?

    You could create a purchase order header with help of some x++ logic. Then add all details manually.

  • CHANDRA1989 Profile Picture
    CHANDRA1989 1,055 on at
    RE: when we delete a purchase order?

    The issue is when there is a problem with PO's in our system, our users have edited a PDF doc and submitted it to the vendor. Now i need the same number to be in the PO on AX System for the same number. So this has to be resolved

    Are you suggesting me to write the close and delete method for purchase order form?

  • CHANDRA1989 Profile Picture
    CHANDRA1989 1,055 on at
    RE: when we delete a purchase order?

    The continuous option is enabled. The issue is when there is a problem with PO's in our system, our users have edited a PDF doc and submitted it to the vendor. Now i need the same number to be in the PO. So this has to be resolved

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: when we delete a purchase order?

    Hi Chandra,

    You have not mentioned yet if you have enabled the continuous option on the number sequence or not. If it is enabled, look at the answers above.

    In my opinion it is not important to have a continuous number here. Only when there is a legislation to have it in your country. Personally I don't care if there is a number not used. Only voucher numbers and invoice numbers should really be continuous.

    I'm aware that some countries have regulations on other documents, but check this for your country.

    Note that using continuous number sequences can also slow down the performance.

  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    RE: when we delete a purchase order?

    Hi,

    I write some code for a customized form, to recover last unused number. I am not sure whether it will work in your case or not, you can try below one.

    1. Write following code in FORM-> Close method

    void close()

    {

       if (numberSeqFormHandler)

       {

           numberSeqFormHandler.formMethodClose();

       }

       super();

    }

    2. Write this code in FORM-> DS-> Delete method

    public void delete()

    {

       element.numberSeqFormHandler().formMethodDataSourceDelete();

       super();

    }

    I hope it will help.

  • Suggested answer
    dolee Profile Picture
    dolee 11,279 on at
    RE: when we delete a purchase order?

    In my experience, the support of continuous number sequence is selective in standard AX.

    PO number is probably one of the un-supported exxample.

    What you can do is look at \Tables\LedgerjournalTable\delete method. There is a line of code there handling the release of general journal sequence number. Implement something similar for PurchTable to enable continuous number sequence to work.

    Note that you should consider under which circumstances the number sequence can be freed and implement that logic also. (e.g. Only PO which have no posting, including confirmation, done would release the PO number)

  • CHANDRA1989 Profile Picture
    CHANDRA1989 1,055 on at
    RE: when we delete a purchase order?

    When I try to manually clean up, there is no process running, this is the case on production. In test and development environment when I do the same, the number is skipped when creating a new PO, but when I look at the status list  there were nothing shown. Is this because of any permission issue?

  • raelhefn Profile Picture
    raelhefn on at
    RE: when we delete a purchase order?

    You can run the cleanup process manually or automatically to recover the lost numbers.

    for more details please refer to this URL

    technet.microsoft.com/.../hh209457.aspx

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans