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)

Error executing code: Performing NEXT operation on joined cursor is not allowed.

(0) ShareShare
ReportReport
Posted on by 135

So I've been getting the error in the title when I try to run a query.  I saw another thread where someone mentioned that the issue for them was that their join statement was incorrect.  However, I've gone through the query several times and I can't figure out where it's going wrong.

            ttsBegin;

            select firstOnly forUpdate aHAShippedCartonStaging where aSalesTable.recid == RetailEventNotificationLog.SalesOrder
            join aWHSShipmentTable where aWHSShipmentTable.orderNum == aSalestable.salesId
            join aWHSContainerTable where aWHSShipmentTable.shipmentId == aWHSContainerTable.shipmentId
            join aHAShippedCartonStaging where aHAShippedCartonStaging.cartonId == aWHSContainerTable.containerId;

            aHAShippedCartonStaging.shipmentEmailSent = NoYes::No;
            aHAShippedCartonStaging.update();

            ttsCommit;

774327.1.PNG4834.2.PNG1030.3.PNG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,178 Most Valuable Professional on at

    It seems that you forgot to join SalesTable, because you use aSalestable variable in the query but you've never selected it.

    By the way, your question isn't very efficient. You fetch all fields from several tables, although you don't need even a single one. You could use update_recordset instead.

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans