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 safely transfer custom fields from Sales Header to Sales Invoice Header during Posting in BC

(0) ShareShare
ReportReport
Posted on by 198

Hi

Question:

I added a custom field Agreement No. to both tables:

  • Sales Header
  • Sales Invoice Header

Both fields have the same Field ID:

field(52160; "Agreement No."; Code[20])

Example:

Before Posting:

Sales Header
Agreement No. = 1

After Posting:

Sales Invoice Header
Agreement No. = ?

My questions:

  1. Does Business Central automatically transfer the value because both fields have the same Field ID and name?
  2. If not, what is the recommended and safest AL approach to transfer custom fields from Sales Header to Sales Invoice Header during posting?

Which Event Subscriber or standard Microsoft pattern should be used?

  1. After posting, if I need to update the value of:
Sales Invoice Header."Agreement No."

is it allowed to modify posted documents?

If yes, what is the correct and recommended way to update a custom field in Sales Invoice Header safely without affecting the standard posting process?

Thank you.

  • Suggested answer
    Tony NAVCore Development Profile Picture
    26 on at

    You are correct that BC will automatically transfer the value because the Field ID is the same.  However, it doesn't matter the name.  This means you can't have 2 fields with 2 different names sharing the same Field ID either.  The value in the Sales Header will carry over to the Sales Invoice Header regardless.  If the fields have different types, you may get an error.

     

    You may want to consider the Sales Cr.Memo Header as well as the Sales Shipment Header.

     

    Don't forget the Sales Header Archive if you enable archiving.

     

    The nice thing about BC is that you don't even need to explicitly implement the transfer code. The standard code is already doing this, so all you need is to introduce the custom field with the same Field ID in the posted side.  Whatever you put into the Sales Header table will automatically transfer to the posted tables without additional coding.

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,479 User Group Leader on at

    Hi @Rami Mazrawi  * ,

    The custom fields values transfer from Sales Header to Sales Invoice Header, Sales Shipment Header, Sales Cr. Memo Header & Return Receipt Header using TRANSFERFIELDS

    TransferFields works on logic: The field should have same Id, Datatype and Length (if applicable) in all tables listed above. 

    ** With Business Central, I feel subscribing event rather than relying on Transfer fields. Not a common practice but make sense to understand field usages in future.

    For older document you can update custom fields in Sales invoice header table, without any issues or via rapidstart package if you have lot of records.

    Regards,

    Saurav Dhyani

    YouTube: saurav dhyani - YouTube

    LinkedIn: Saurav Dhyani | LinkedIn

    Blog: Saurav Dhyani - #MSDynNAV & #MSDyn365bc

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 739 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 462 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 406 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans