Dynamics Business Central / NAV Developer Digest - Vol. 502

Dynamics Business Central / NAV Developer Digest - Vol. 502

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central and Dynamics NAV development. This week’s volume includes comparing OnAfterGetRecord() and OnAfterGetCurrRecord() triggers, the new Word add-in in BC25, and recognition for Microsoft experts.

The Dynamics 365 Business Central community, consisting of developers, project managers, and consultants, collaborates across various platforms to share valuable insights. At ArcherPoint, we greatly value their dedication and expertise. To ensure widespread access to this technical knowledge, we created Developer Digest.

Difference between OnAfterGetRecord() and OnAfterGetCurrRecord() triggers

Question:

What is the difference between the page triggers OnAfterGetRecord() and OnAfterGetCurrRecord()?

Answer:

In Business Central, the OnAfterGetRecord and OnAfterGetCurrentRecord triggers are used in pages, but they serve different purposes and are triggered at different times in the process of interacting with records:

The OnAfterGetRecord trigger is called after each record is retrieved or fetched from the data source (e.g., table) in a loop and is independent of the currently selected record in the UI. It is triggered for every record in the dataset when navigating, filtering, or loading a list of records. It is typically used in list pages or repeated record contexts (like a subpage), where actions or calculations are needed after retrieving each record in the list. For example, if you are working with a list page, this trigger is invoked for every record shown in the list as it is loaded, allowing you to modify or take action on each one.

The OnAfterGetCurrentRecord trigger is called after the user interacts with the current record. This could be when the user selects a record in a list or form and performs an action, such as clicking a button or navigating to a new page. It is typically used when you need to take action or perform a calculation based on the currently selected record. This is often useful in card pages or scenarios where you need to update or react to changes in the currently active record (e.g., updating fields based on selections). For example, in a card page, this trigger is fired when the user moves from one record to another or when a record is specifically selected.

The main difference between the two triggers is that OnAfterGetRecord runs after a record is retrieved but before it is displayed, while OnAfterGetCurrentRecord runs after the current record is retrieved.

OnAfterGetRecord is more general and runs as part of the record-fetching process for displaying records, while OnAfterGetCurrentRecord is specific to user interaction with a record.

Coming in BC25: Word add-in

Now, in preview, Microsoft is providing an add-in that gives Business Central users more control over the Word layout feature. Users can change layout properties, including margins and orientations, and download a Word layout template for a report. The new feature moves the product closer to a true no-code solution when developing reports using Word layouts.

See Bert Verbeek’s blog, Preview BC25: Word add-in to the rescue.

You can download the new Word add-in from Microsoft’s AppSource.

Demiliani and Tacconi: Get the latest edition of their Business Central development guide

The second edition of Mastering Microsoft Dynamics 365 Business Central: The complete guide for designing and integrating advanced Business Central solutions by BC experts Stefano Demiliani and Duilio Tacconi was published earlier this year by Packt Publishing. The book follows best practices throughout and covers everything from AL language fundamentals to Power Platform integration and utilizing Azure Services.

Congratulations, Mohana Yadav!

Microsoft’s Dynamics 365 Community shines the spotlight on ArcherPoint’s Mohana Yadav this month. Mohana has extensive experience with Business Central and the Microsoft ecosystem. He is being recognized by the Dynamics 365 Community as a technical expert, a mentor, and a leader. Join us in congratulating Mohana!

Join us for Community Summit NA 2024

Community Summit North America 2024 is coming October 13-17 to San Antonio, Texas. Learn from Microsoft experts, MVPs, and partners presenting over 600 sessions on Microsoft Dynamics products, Power Platform, Fabric, and AI.

Watch as ArcherPoint president Tammy Fawcett talks with Cam Sessinger of Dynamics Communities about ArcherPoint’s plans for Summit.

 Register now and receive a discount on your registration. Be sure to visit us at booth #1209!

++++++++++++++++++++

Are you interested in Dynamics NAV and Business Central development? Check out our collection of NAV/BC Development Blogs.

Read “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.

Trending Posts

Stay Informed

Choose Your Preferences
First Name
*required
Last Name
*required
Email
*required
Subscription Options
Your Privacy is Guaranteed