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...
Suggested Answer

Split PO Line Into Two

(1) ShareShare
ReportReport
Posted on by 139
Hi all,
 
 previously i asked One question related Split Po line into Two line..
I splited line into two line .. but what my  question is how to handle line no for more than one original Po line record .. & how to split it ?
 
here i paste my code ..
anyone correct my code.
 
 
 
 
thanks In Advance .. 
 
I have the same question (0)
  • Netjacker2097 Profile Picture
    286 on at
    hi,
     
    please try this: 
     
    SplitQty := ABS(Rec."Quantity Received") / 2;
    IF SplitQty > 0 THEN BEGIN
        Rec.LOCKTABLE;
        
        WHILE (Rec."Quantity Received" > 0) DO BEGIN
            Newpurchaseline.INIT;
            Newpurchaseline.TRANSFERFIELDS(Rec);
            
            Newpurchaseline."Line No." := Rec."Line No." + (10000 * SplitCounter); 
            Newpurchaseline."Quantity Received" := MIN(SplitQty, Rec."Quantity Received");
            
            Rec."Quantity Received" -= Newpurchaseline."Quantity Received";
            
            Newpurchaseline.INSERT;
            
            SplitCounter += 1;
        END;
        MESSAGE('Split Line Complete');
    END;
    Thanks,
    M
  • Suggested answer
    YUN ZHU Profile Picture
    99,689 Super User 2026 Season 1 on at
    This depends on the sorting method you need. If you want it to be sorted below this line, I think "Line No./2" would be better.
    PS: Business Central Standard Error: The line cannot be split & There is not enough space to insert correction lines (AutoSplitKey Property)
     
    Hope this helps as well.
    Thanks.
    ZHU

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,948 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,048 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 727 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans