web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Flow a custom field from an item journal to warehouse entry

(1) ShareShare
ReportReport
Posted on by 74
Hi All,
 
I have created and added a custom field to the Item journal table and in turn also added that custom field to the Item ledger Entry table. This works perfect when posting. However, I also need to get the custom field to the warehouse entry table ultimately. The problem I have is I just cannot find the connection between when and where exactly information from the item journal line gets transferred over to, I believe it would have to be the warehouse journal line and then registered to the warehouse entry table.  
 
I have looked deeply into code unit 22 Item Jnl.-Post-Line and also the codeunit 7301 Whse. Jnl.-Register Line. I just cannot figure out where exactly, when an item journal line gets posted from the Item journal, the information flows to the warehouse journal line and subsequently gets registered to the warehouse entry table. 
 
Any suggestions would be greatly appreciated. I am working in Business Central Version 25.0. 
 
 
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    25,365 Most Valuable Professional on at
  • Suggested answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at
    You need to add the same field in Warehouse Journal Line and then pass to the table and then you can pass it  to warehouse entry. To pass value to warehouse journal line check codeunit 7032 CreateWhseJnlLine function then in the codeunit 7301 you can pass from whse journal line to warehouse entry.
     
    Thanks
    Suresh
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,612 Super User 2025 Season 2 on at
  • Verified answer
    Zafar LIT Profile Picture
    74 on at
    Hi everyone thanks for the response:
     
    I have dived deeply into the code and realized that there is no relationship between Warehouse Entry table and for example Item ledger entry tables. To be more precise there is a way through Source Type and Source No. to find linked entries, but there are also warehouse entries that are not linked to item ledger entries. 
     
    What helped me was the event recorder option. 

    I figured out that the code unit 7301 Whse. Jnl-Register Line, is where all the action happens. 

    I used
     [EventSubscriber(ObjectType::Codeunit, CodeUnit::"Whse. Jnl.-Register Line", 'OnInitWhseEntryCopyFromWhseJnlLine', '', false, false)]
      
    This event to lookup the custom value I needed to be passed over to the warehouse item journal and also ran field validations. After validated I assigned my warehouse entry custom field with the validated custom value on a warehouse journal record.
     
    Next I used OnBeforeInsertWhseEntry
     [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse. Jnl.-Register Line", 'OnBeforeInsertWhseEntry', '', false, false)]
     
    to assign the custom field in the warehouse entry table to the from my custom field value in the Warehouse journal. 
     
    I hope this helps others to also achieve similar results. Summarizing I feel that there are two important take aways:
    1. You have to develop a good understanding of the inner workings of the data model for business central and the business logic applied through the relevant Codeunits.
    2. You need to find the correct events to hook into to be able to correctly and efficiently extend your solution. The event recorder option was handy, if you use it wisely imo. 
    From point 1 I was able to deduce that code unit 7301 handles warehouse entry registering. If you know that you can use the event recorder to record when you register an item journal line. Next export the recorded events to excel and filter the excel list to only the event of Codeunit 7301. ORder then in sequence and you get a very nice view of the logic and order in which events trigger.  

    I hope this helps others.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans