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

Update purchase header "posting description" with the line first line similar to the G/L entry

(0) ShareShare
ReportReport
Posted on by 10
BC allows for us to carry the  line description to the General Ledger entry when posting. I would like to do similar but to the /Posting Description/. I know there is the code inthe Purchase Header:
    local procedure InitPostingDescription()
    var
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeInitPostingDescription(Rec, IsHandled);
        if IsHandled then
            exit;

        Rec./Posting Description/ := Format(Rec./Document Type/) + ' ' + Rec./No./;
    end;
 
 
 
What can I do before then to copy the first line description to the /Posting Description/ on the header? Is it creating a code unit event subscriber to the OnBeforeInitPostingDescription, or is there some other method?
 
Thanks,
 
I have the same question (0)
  • Suggested answer
    HVGEEL Profile Picture
    310 on at
    As you state correctly in your question: this is a HEADER function.
    In the header, things are rather straightforward: initialise the Psting Description to DocType + RecNo, allow the user to chage it afterwards.  End of story. Simple.
     
    If your requirement is to have the description of the first purchase line in the posting description, you will encouter a lot of issues along the way:
     
    - what if the first line gets deleted? Another line will become the first line and you will need to handle that
    - what if the Get ReceiptLines() function is called: in that case your first line will be a textline referring to a the first receipt on the invoice.
    - what if the first line is just a comment, and not a 'real' line: bottomline question: what do you consisder to be the first line?
     
    The only workable solution in my opinion is to determine the 'first line' in the Release() or Request Approval(depening on your setup) events.
    That of course will override the manual input the user has given.
     
    so I leave you with 2 questions:
    - what do you call the first line
    - how much work do you want to spend on coding the housekeeping for this?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,260 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,515 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,373

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans