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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

SalesOrder Status Changed While Delete Item through Code

(0) ShareShare
ReportReport
Posted on by 810

Hi Guys,

in my salesorder 2 item is there. when i delete 2 item through code then salesorder status changed OpenOrder to Cancel. Here i have to Do like when i delete one item from SalesOrder (Status OpenOrder)Item line through Code then that SalesOrder status Changed to Calcel. How can i  SalesOrder Status Changed Calcel to OpenOrder.

Note : - After Deleting Item from SalesOrder When I Open in Edit Mode and Changed Line Property and Confirm that time Changed Status calcel to OpenOrder. i don;t want to Edit LIne item Property. directly i want to changed status  by code.

Thanks.

*This post is locked for comments

I have the same question (0)
  • UmesH@ Profile Picture
    810 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    Thanks for Your Quick Reply Fredrik Sætre and André Arnaud de Calavon.

    Now i have Solved My issue.

    Thanks.

  • Verified answer
    UmesH@ Profile Picture
    810 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    OldSO.JPG

    See this Image to understand Correctly and i have Solved my Problem. i don't know how it's Solved but. now i m Not getting Original Sales Order Status "Canceled".

    Thanks for your Quick Reply.

    Here i have Attached my Solved Images.

    OldSO.JPG

    Thanks Guys.

  • Fredrik Sætre Profile Picture
    12,644 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    Oh! Just read your response to André.

    So you only want ONE order line pr. sales order? And if you some how have messed it up, then you create multiple orders programmatically?

  • Fredrik Sætre Profile Picture
    12,644 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    Ok. It is a bit hard to read your English, but if I understand correctly:

    When you run your code that delete items, your sales order status changes to canceled.

    Can I suggest that you create a step in your code that runs through and delete existing open sales order lines first?

    You should not be able to delete order lines that are delivered...

  • UmesH@ Profile Picture
    810 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    No, I want minimum One line in SalesOrder. Here i want like, if in Open SalesOder there are 2 or 3 Line then i want to Spilt it for every line. if there are 2 line then i want to create sales order for second line. and my old which is Original SO there are two line and new SO created from that SO. and I want to delete Second line from Orinial SO. because i have created new SO for that line.

  • André Arnaud de Calavon Profile Picture
    298,959 Super User 2025 Season 2 on at
    RE: SalesOrder Status Changed While Delete Item through Code

    Hi Jignesh,

    Can you tell if there are more sales order lines in this order? Do you have this behavior when you have one sales order line which will be deleted though coding?

    The status is usually maintained automatically based on the minimum status of all sales order lines. So when there is one line remaining with the status 'Open order', also the header should get this status.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans