Skip to main content

Notifications

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

(1) ShareShare
ReportReport
Posted on by 205
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.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 76,716 Super User 2025 Season 1 on at
    How to insert sales line-? Item type:: G/L into warehouse shipment line in business central
    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
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 25,565 Super User 2025 Season 1 on at
    How to insert sales line-? Item type:: G/L into warehouse shipment line in business central
  • Suggested answer
    Mustafa Omerbegović Profile Picture
    Mustafa Omerbegović 1,184 Super User 2025 Season 1 on at
    How to insert sales line-? Item type:: G/L into warehouse shipment line in business central
    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
    Yi Yong Profile Picture
    Yi Yong 1,737 Super User 2025 Season 1 on at
    How to insert sales line-? Item type:: G/L into warehouse shipment line in business central
    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,779 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans