Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Error when deleting sales order

Posted on by 732

Hi everyone!

I'm working with BC cloud, US version. When trying to delete a sales order, I get this message:

pastedimage1672053828350v1.png

The order does not have any lines created (I can create and delete lines in the form). 

We tried copying the environment to debug (this is a live environment), but this does not happen in the copied environment.

I can delete other sales orders, the issue is with this one. We already tried uninstalling extensions and we still get the message. 

If anyone could help me, I would appreciate it. 

Thank you!

Categories:
  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Error when deleting sales order

    Sometimes just the strangest things happens that not always can be explained :)

    Glad you got it fixed.

  • Valeria Montagut Profile Picture
    Valeria Montagut 732 on at
    RE: Error when deleting sales order

    Hi Inge and Greg,

    Finally, we could delete the order, we had to remove all fields, including customer No, and then (just then) we could delete the order.

    So, I think it's solved by now, but I have no idea why we got that message in first place.

    Thank you for your help!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Error when deleting sales order

    I agree with Greg. Try to delete the salelines first. And if that does not help. You can contact your partner. They should be able to delete the order for you pretty easily by creating a temporary custom code that will delete it.

    Starting a support ticket with Microsoft will have to be done through your partner if that is needed, but the partner should be able to fix this without involving Microsoft.

  • Suggested answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: Error when deleting sales order

    Did you try deleting all the lines first? If not, that's a very good idea as it simplifies the deletion down to 1 record at a time.

    If you've uninstalled all extensions and the error still occurs, then this might be caused by an integration you might have with Dataverse or CRM for example. This is where debugging would help to show what is causing the error.

    Another approach would be to actually post the order. (This is not a recommended approach, but if you're out of options--it might be acceptable to you.) You would just want to zero all lines (or delete them all) and then simply have a meaningless line (like a G/L line) with Qty 1 and $0 amount. That should have no accounting affect--but it could possibly have a sales reporting affect (for example if you measure a customer's Last Sale Date, or # of Orders then that could be affected by this approach)--so be careful.

    You can also involve Microsoft support. If you're on Microsoft SAAS, then you should be able to start a support ticket yourself.

  • Valeria Montagut Profile Picture
    Valeria Montagut 732 on at
    RE: Error when deleting sales order

    We uninstalled extensions and still got the message, so I'm thinking it's not because of a development. If we had anything written on page level, it should not be working without the extension installed.

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Error when deleting sales order

    hi

    share your code pls

    DAniele

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    RE: Error when deleting sales order

    Hi, This looks like a problem caused by customization. And it is difficult to help without the code. You can try to debug.

       

    And if you are not a developer, you can try to find the code detailing the error in the function below.

    pastedimage1672096499616v1.png

    pastedimage1672096569764v2.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    pankaj.k Profile Picture
    pankaj.k 962 on at
    RE: Error when deleting sales order

    Hi

    Check your code or any  extension if you write any code on page level.

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans