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

Posted on by 201
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.
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,330 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 24,404 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,095 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,961 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,443 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans