Skip to main content
Business Central forum
Suggested answer

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

editSubscribe (0) ShareShare
ReportReport
Posted on by 614

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?

Categories:
  • Suggested answer
    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
    Nick Webb 614 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
    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
    Nick Webb 614 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
    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
    DAnny3211 9,180 Super User on at
    RE: Copy Line [Description 2] to G/L Entry [Comment] field

    Hi

    requires the development of a custom AL extension

    DAniele

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,030 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans