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...
Suggested answer

Copy Line [Description 2] to G/L Entry [Comment] field

(0) ShareShare
ReportReport
Posted on by 721

I've had a request and I'm not sure if it's possible in BC.

Can the value in field: Description 2 (12, Text[50]) of an Invoice Line (Table: 37) with Type: G/L Account be carried to field: Comment (5618, Text[250]) of table: G/L Entry (17) during a Post?

Is this configurable in BC or would it require a custom AL extension?

  • Suggested answer
    Shathika Karunaratne Profile Picture
    on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Put debugger and put break point to the Post action. Then you can move ahead one by one line and read them.

    Thanks

    Please do verify if it helps you

  • Nick Webb Profile Picture
    721 on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Thanks for your help. I have one last question if I may, for future reference: How did you zoom in on which events to subscribe to. I tried using the Event Recorder in BC and it returned over 300 event calls. I Started just before a Sales Invoice Post and stopped straight after. Is there a better way of drilling down to the relevant event or events?

  • Suggested answer
    Shathika Karunaratne Profile Picture
    on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Hi,

    Yes you can filter the particular Sales Line via Document No. and Document Type

    Sales Line. Document No=Sales Header.No.

    Sales Line. Document Type=Sales Header.Document Type

    Thanks

  • Nick Webb Profile Picture
    721 on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Thanks for the tip on the events. Just checking, this hooks me into the Sales Header when I want the Sales Line(s). Is there an event for that or do I need to get the detail lines from the Sales Header in the events you've provided?

  • Suggested answer
    Shathika Karunaratne Profile Picture
    on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Hi,

    Yes, have to do a customization. below are the events that you need to trigger

    [EventSubscriber(ObjectType::Table, 81, 'OnAfterCopyGenJnlLineFromSalesHeader', '', true, true)]

    local procedure OnAfterCopyGenJnlLineFromSalesHeader(SalesHeader: Record "Sales Header"; VAR GenJournalLine: Record "Gen. Journal Line")

    [EventSubscriber(ObjectType::Table, 17, 'OnAfterCopyGLEntryFromGenJnlLine', '', true, true)]

    local procedure OnAfterCopyGLEntryFromGenJnlLine(VAR GLEntry: Record "G/L Entry"; VAR GenJournalLine: Record "Gen. Journal Line")

    Thanks

  • Suggested answer
    DAnny3211 Profile Picture
    9,274 Moderator on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Hi

    requires the development of a custom AL extension

    DAniele

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,011 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans