Skip to main content

Notifications

Announcements

No record found.

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,221 Super User 2024 Season 2 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,426 Super User 2024 Season 2 on at
    How to insert sales line-? Item type:: G/L into warehouse shipment line in business central
  • Suggested answer
    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,704 Super User 2024 Season 2 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,904 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans