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 :
Small and medium business | Business Central, N...
Answered

How to remove one item from multiple (like 100 or more) sales order?

(0) ShareShare
ReportReport
Posted on by 15,613

Hi

Sometimes we sell one item but later we realize we cannot source it anymore. Then we need to remove that item from many sales order. Is it any easy way to remove one item from all sales order lines?

If it is not possible OOTB then any ISV? If no  ISV then I assume customization is the path to go or can you do this using Power Automate? 

Thanks 

I have the same question (0)
  • black_s Profile Picture
    328 on at

    Hi ,

    This may assist.

    Export the sales line table with a filter of that item number.

    Then blank out the excel leaving it with the doc no, line no only populated.

    Import back and overwrite with blank data

  • Suggested answer
    YUN ZHU Profile Picture
    101,458 Super User 2026 Season 1 on at

    Hi, Maybe you can try to use Configuration Package.

    Export all Sales Lines -> Delete all rows of the item in Excel file -> Enable Delete Table Records Before Processing, and then import the excel.

    pastedimage1681085458687v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    MahGah Profile Picture
    15,613 on at

    Thank you both

    configuration package will not work since 1) this needs to be done by end user such as customer service 2) it is risky since it could cause deleting of entire sales line table

    Looks like the only option is development since I could not find any ISV

  • Suggested answer
    Tech-Lucky Profile Picture
    1,288 Moderator on at

    There is an option for customization you can make the XML Port where you need to define 2 fields one is Sales Order No and Other is Item No. and you can do the code on the XML port to delete the Uploaded Files from the Sales Line once this uploader is made this can be done by a customer also he just needs to prepare the CSV file and Upload it.

    if you don't know how to do customization then you can take my help.

    To help other members of the community please verify my answer if you find my answer helpful

  • Suggested answer
    DAnny3211 Profile Picture
    11,421 Super User 2026 Season 1 on at

    hi

    there is no out-of-the-box functionality to remove one item from all sales order lines at once. However, there are several ways you can achieve this, including using an ISV solution, customization, or Power Automate.

    If you're looking for an ISV solution, you can search for available extensions in the Microsoft AppSource marketplace. There are several extensions available that provide features related to inventory management and sales orders.

    If you decide to go for customization, you can either hire a Business Central developer or do it yourself if you have the necessary development skills. Customization involves modifying the code of your Business Central instance to add new functionality or change existing behavior. A developer can help you create a customization that allows you to remove the item from all sales order lines.

    Alternatively, you can use Power Automate to automate the process of removing the item from all sales order lines. You can create a flow that runs whenever the item is marked as "out of stock." The flow can then iterate through all sales order lines that contain the item and remove it.

    In conclusion, there are several ways to remove an item from all sales order lines in Business Central. You can use an ISV solution, customize the code, or create a flow in Power Automate.

    DAniele

  • MahGah Profile Picture
    15,613 on at

    DAnny3211  I like your idea about Power Automate. But do you have any example for it? I mean how we can define which item no we want to delete then which function of Power Automate we need to use? If you point me to anything similar it can help a lot.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    A simple custom report will be the best way to do this I think.

    report 50100 DeleteOrderLines
    {
        ApplicationArea = All;
        Caption = 'DeleteOrderLines';
        UsageCategory = Tasks;
        ProcessingOnly = true;
        dataset
        {
            dataitem(SalesLine; "Sales Line")
            {
                trigger OnAfterGetRecord()
                begin
                    If SalesLine."No." ='TheNumberYouNeedToDelete' then SalesLine.Delete(true);
                end;
            }
        }
        requestpage
        {
            layout
            {
                area(content)
                {
                    group(GroupName)
                    {
                    }
                }
            }
            actions
            {
                area(processing)
                {
                }
            }
        }
        
    }
    

    This will run through all your saleslines and delete the ones with the item number you compare with.

    And as always - test in a sandbox.

  • MahGah Profile Picture
    15,613 on at

    Hi Mr Bruvik

    Thank you so much for the code. I will test this in the Sandbox. I really appreciate your help here.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,260 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,515 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,373

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans