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

How to insert sales line-? Item type:: G/L into warehouse shipment line in business central

(2) ShareShare
ReportReport
Posted on by 323
Hi Guys,
I am facing one query.
I know on warehouse shipment there is no G/L line ,but we need to do this customization.
I have one sales order ,and on that sales order line we have some G/L lines.so i need to insert only this G/L line into warehouse shipment line.
actually on warehouse shipment,we have one report ,and on that report we need to show G/L lines for that associated sales order.=> report layout is working fine.
So i am writing the below code on Warehouse shipment Header->Onafttergetrecord trigger of dataitem. As per my below code, line is inserted for item.but i want only G/L line record to be inserted into warehouse shipment line.
Below is the my sales order: which have 3 lines: i.e. 2 items line & 1 G/L line.
ANd below is the warehouse shipment,which i have created from that sales order.
I have the same question (0)
  • Suggested answer
    Yi Yong Profile Picture
    2,721 Super User 2026 Season 1 on at
    Hello,
     
    Here are some of the findings:
     
    Assuming there is only one G/L account on SalesLine, you can use FindFirst.
     
    Ideally, you should not insert into warehouse shipment lines as you may cause potential issues.
    It is best to create a new line table with relation to warehouse shipment header for this purpose.
    Then simply add another dataset in your warehouse report to generate the G/L lines.
  • Suggested answer
    Mustafa Omerbegović Profile Picture
    1,477 Moderator on at
    Hello,
     
    if your goal is to ''and on that report we need to show G/L lines for that associated sales order'' then I don't understand why you need to add an additional line in the warehouse shipment line.
     
    Why do you not use data from Sales orders?
     
    If the G/L lines are only required for reporting purposes and not operationally needed in the Warehouse Shipment Lines, create a report that directly pulls the required data from the Sales Lines without inserting it into the Warehouse Shipment Lines.
     
    I think that it's easier to implement rather than the development of inserting a G/L line in the shipment which can cause you a lot other problems later.
     
    Greetings  
  • Suggested answer
    Valentin Castravet Profile Picture
    32,689 Super User 2026 Season 1 on at
  • Suggested answer
    YUN ZHU Profile Picture
    100,974 Super User 2026 Season 1 on at
    I agree with Mustafa, this is a risky customization.
    If you just want to get the report, you should get it directly from the associated Sales Order. If you want to post the G/L Account Lines on the Sales Order at the same time, you can also post it directly from the code instead of inserting it into the Warehouse Shipment.
     
    Hope this helps.
    Thanks.
    ZHU
  • Mitr Profile Picture
    194 on at
    Hi @YUN ZHU,
    can please help how to do this in business central?
    If you want to post the G/L Account Lines on the Sales Order at the same time, you can also post it directly from the code instead of inserting it into the Warehouse Shipment.

    I have tried it but it does not work. BC24.5 onprem.

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,086 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,290 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,218

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans