web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2009 error when release approved purchase requisitions details

(0) ShareShare
ReportReport
Posted on by

hi all

i am testing the purchase requisition workflow in AX 2009

the P.R. workflow function can run correctly. and it can be complete successfully.

but it can not auto create P.O. or use the function "release approved purchase requisitions details" to manual to create purchase orders.

when i click "create purchase orders" button, it show the following error message.

---Cannot edit a record in Purchase orders (PurchTable).
---The record has never been selected.

can anyone help me please? how should i do now. thank you very much.

 

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    304,688 Super User 2026 Season 1 on at

    Are you using standard AX on these features or are there some customizations?

  • Community Member Profile Picture
    on at

    yes, i am using standard AX 2009

  • André Arnaud de Calavon Profile Picture
    304,688 Super User 2026 Season 1 on at

    As the message tells you that a record cannot be edited, it is trying to update. Or the Purchase Header is not created or there are some other problems (missing setup). Is it possible to purchase orders directly?

    You can use the debugger to trace this one and see why the error occurs. If you are not technical, a developer needs to do this for you. Set a breakpoint somewhere on the add method of the infolog class. When a message is generated, the system will hold and it is then possible to track which methods were passed.  

  • Community Member Profile Picture
    on at

    hi, André Arnaud de Calavon

    Thanks for your reply,

    we can create P.O. directly.

    i am IT support in a company.

    i try to learn the debugger to troubleshooting it now. but it seems a little hard.

  • Community Member Profile Picture
    on at

    after use the debugger, it cause the error from following code.
    but i still don't know why. :(
    please help me. thanks a lot.

    \Classes\PurchLineType\insert
    ================================================================================================
    public void  insert(boolean     dropInvent      = false,
                        boolean     findMarkup      = true)
    {
        #OCCRetryCount
        InventUpd_Estimated estimated;
        NumberSeq           numberSeq;
        InterCompanySkipUpdate  interCompanySkipUpdate = purchLine.SkipUpdate;
        ;
        try
        {
            ttsbegin;

            this.setReverseCharge_UK();

            purchTable = purchLine.purchTable(update);

            if (purchTable.isInterCompanyOrder() && purchLine.inventTable().interCompanyBlockedPurch())
                throw error(strfmt("@SYS74812", purchLine.ItemId));

            if (purchLine.SkipUpdate == InterCompanySkipUpdate::No
            &&  purchTable.interCompanyAllowIndirectCreationOrig())
                throw error(purchTable.interCompanyAllowIndirectCreationOrig());

            if (purchLine.creditNoteLine())
                purchLine.TransactionCode = IntrastatParameters::find().DefaultCreditNote;

            numberSeq = NumberSeq::newGetNum(InventParameters::numRefInventTransId());
            purchLine.InventTransId = numberSeq.num();

            if (!purchLine.VendAccount || !purchLine.VendGroup)
            {
                purchLine.VendAccount      = purchTable.OrderAccount;
                purchLine.VendGroup        = purchTable.VendGroup;
            }

            if (purchLine.SkipUpdate   != InterCompanySkipUpdate::InterCompany
            &&  purchLine.SkipUpdate   != InterCompanySkipUpdate::Both)
                this.interCompanyMirror();

            purchLine.setPurchStatus(); <<<<<<<<<<<<<<<THIS ROW CAUSE ERROR MESSAGE.


            if (!dropInvent)
            {
                estimated = InventUpd_Estimated::newInventMovement(InventMovement::construct(purchLine));
                estimated.updateNow();
            }

            purchLine.doInsert();

            if (purchLine.SkipUpdate   != InterCompanySkipUpdate::Internal
            &&  purchLine.SkipUpdate   != InterCompanySkipUpdate::Both)
                this.syncSalesLineSave(purchLine,true);

            if (estimated)
                estimated.updateReservation();

            purchTable.updateBackStatus();

            if (findMarkup
            && (purchLine.PurchQty   >= 0
            || (purchLine.PurchQty   <  0 &&
                purchLine.SkipUpdate == InterCompanySkipUpdate::No)))
                purchLine.createMarkupTrans(purchTable);

            if (findMarkup
            &&  purchLine.PurchQty   <  0
            &&  purchLine.SkipUpdate == InterCompanySkipUpdate::Internal)
                purchLine.interCompanyRevertMarkupTrans();

            if (purchLine.SkipUpdate   != InterCompanySkipUpdate::InterCompany
            &&  purchLine.SkipUpdate   != InterCompanySkipUpdate::Both)
                this.interCompanyMarkupMirror();

            purchLine.SkipUpdate = InterCompanySkipUpdate::No;
            purchLine.doUpdate();

            ttscommit;
        }
        catch (Exception::Deadlock)
        {
            retry;
        }
        catch (Exception::UpdateConflict)
        {
            if (appl.ttsLevel() == 0)
            {
                if (xSession::currentRetryCount() >= #RetryNum)
                {
                    throw Exception::UpdateConflictNotRecovered;
                }
                else
                {
                    retry;
                }
            }
            else
            {
                throw Exception::UpdateConflict;
            }
        }
        catch (Exception::Error)
        {
            ttsabort;
            throw error("@SYS93835");
        }

        if (interCompanySkipUpdate == InterCompanySkipUpdate::No)
        {
            this.interCompanyCalcDisc();
        }
    }
    ================================================================================================

     

     

    \Data Dictionary\Tables\PurchTable\Methods\updateBackStatus
    ================================================================================================
    void  updateBackStatus()
    {
        PurchTableType purchTableType;
        ;

        purchTableType = this.type();
        purchTableType.updateBackStatus();    <<<<<<<<< INSIDE THE FUNCTION, THIS ROW CAUSE ERROR MESSAGE.
    }
    ================================================================================================

     

    \Classes\PurchLineType\updateBackStatus
    ================================================================================================
    void  updateBackStatus()
    {
        ttsbegin;
        purchTable.PurchStatus = PurchLine::lowestPurchStatus(purchTable.PurchId);
        purchTable.doUpdate(); <<<<<<<<< FINALLY, INSIDE THE FUNCTION, THIS ROW CAUSE ERROR MESSAGE.
        ttscommit;
    }
    ================================================================================================

     ERROR:
    ---Cannot edit a record in Purchase orders (PurchTable).
    ---The record has never been selected.


     

  • Verified answer
    André Arnaud de Calavon Profile Picture
    304,688 Super User 2026 Season 1 on at

    Hi,

    In the debugger you can look for variables and the used values. Does the PurchTable has a record-id? If not, try to add a brakpoint on the insert method of the purchlinetype class. Do this directly after the line "   purchTable = purchLine.purchTable(update);".

    Then you can see if the PurchTable is retrieved or not.

  • Community Member Profile Picture
    on at

    thank you again, André Arnaud de Calavon

    the PurchTable has a record-id before it step into the purchlinetype class.

    but the PurchTable is not retrieved after line "purchTable = purchLine.purchTable(update);".

  • Community Member Profile Picture
    on at

    thanks,

    the vendor help us to fixed the problem finally. it is cause by the P.O. number is not set to auto create.

    our production server is using manual input P.O. number setting. so cause the error.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans