Dynamics NAV / Business Central Developer Digest - Vol 359

Dynamics NAV / Business Central Developer Digest - Vol 359

The ArcherPoint Developer Digest is focused on Microsoft Dynamics 365 Business Central development and Dynamics NAV development. In this edition of Developer Digest, we discuss using Copy/Paste from BC18 Into Excel, order of execution of Report Triggers in BC, and more.

The Dynamics NAV and Business Central community, including the ArcherPoint technical staff, is made up of developers, project managers, and consultants who are constantly communicating, with the common goal of  sharing helpful information with one another to help customers be more successful.

As they run into issues and questions, find the answers, and make new discoveries, they post them on blogs, forums, social media…so everyone can benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this community—so we thought, wouldn’t it be great to share this information with everyone who might not have the time to check out the multitude of resources out there? So, the ArcherPoint Microsoft Dynamics NAV Developer Digest was born. Each week, we present a collection of thoughts and findings from NAV/BC experts and devotees around the world. We hope these insights will benefit you, too.

Generating URLs to Send Users to a Specific Page Record in Dynamics 365 Business Central 

Tom H asks: “Does anyone know how to generate a URL for Business Central to get to a specific record in a page? I have a customer who wants to send out links to specific opportunities to their sales reps, and it is not as obvious or easy as I had hoped.” 

Kyle Hardin replies with this help article by Microsoft for System.GetUrl Method 

Tom appreciates it: “Thank you, Kyle! This is exactly what I was looking for.” 

Order of Execution of Report Triggers in Business Central 

Matt T observes: “Can I just say that the order of execution of report triggers is way more complicated than it used to be? I swear this used to be a quarter of the size.” 

ROOT OnAfterSubstituteReport  

ROOT OnInitReport  

ROOT OnInit –PAGE  

ROOT OnAfterHasCustomLayout  

ROOT OnAfterGetPrinterName  

ROOT OnOpenPage –PAGE  

ROOT OnAfterGetCurrRecord –PAGE  

CHILD OnInitReport –PAGE  

CHILD OnInit –PAGE   

CHILD OnOpenPage –PAGE  

CHILD OnClosePage –PAGE   

CHILD OnPreReport  

CHILD OnAfterGetPaperTrayForReport  

CHILD MasterRecord - OnPreDataItem  

CHILD MasterRecord - OnAfterGetRecord 1  

CHILD MasterRecordLines - OnPreDataItem  

CHILD MasterRecordLines - OnAfterGetRecord 101  

CHILD MasterRecordLines - OnPostDataItem  

CHILD MasterRecord - OnPostDataItem  

CHILD OnAfterHasCustomLayout  

CHILD OnPostReport  

CHILD OnMergeDocumentReport  

ROOT OnQueryClosePage –PAGE  

ROOT OnClosePage –PAGE  

ROOT OnPreReport  

ROOT OnAfterGetPaperTrayForReport  

ROOT MasterRecord - OnPreDataItem  

ROOT MasterRecord - OnAfterGetRecord 1   

ROOT MasterRecordLines - OnPreDataItem  

ROOT MasterRecordLines - OnAfterGetRecord 101  

ROOT MasterRecordLines - OnPostDataItem  

ROOT MasterRecord - OnPostDataItem  

ROOT OnPostReport   

ROOT OnMergeDocumentReport  

Tom H responds: “We asked for extensible reports, and I suppose we got what we asked for.”  

Kyle offers: “I think they are trying to break it up into discrete pieces so the data gathering, layout formatting, and final delivery (PDF, print, email, whatever) are separate entities.” 

Issue When Using Copy/Paste from Business Central 18 Into Excel    

Leanne requests help: “Hi all. One of our upgrade customers has noticed an issue when exporting to Excel. She has an Excel spreadsheet she uses as a template to calculate state sales taxes. Currently (NAV 2009), she exports the Trial Balance to Excel, then does a copy/paste of the Trial Balance into the template. She has calculations in some cells in the template. When she exports from NAV 2009, a zero in the Debit or Credit column comes over as a blank cell (format = General).

Her formula uses these cells to calculate a number in another cell. The blank cell is interpreted as zero. However, when she exports the Trial Balance from BC 18 and copies it into the spreadsheet, the blank cells are not interpreted as zero, and the formula errors. The format of the cells from the BC 18 export is also General. If we type a zero into the blank cell, the formula works. If we then delete the zero from the cell, the formula continues to work. Changing all the blanks to zeros can be the solution, I guess, but the spreadsheet often contains thousands of lines. Has anyone else seen this and found a different workaround?” 

Matt T offers this solution: “I would just use ISNUMBER in Excel. If it’s not interpreted as a number, use 0.” 

Working with Nested Repeaters in a Word Report 

Ian asks: “Has anyone ever worked on a nested repeater in a Word report? Basically, it has two layers: 1) Item No. on one line; and 2) nested underneath, it should print all the Serial Numbers. The Serial Numbers are under the Item (Line) in the XML Mapping, so the schema is there to support it, but it does not work when I add the second line for the Serial Numbers. In RDLC, this is no problem; however, the customer has a specific need for a Word report in this case, so I’m stuck with it. Is there a report available like this somewhere that I could use for reference? Any other ideas?”  

Figure 1 – Nested repeater in a Microsoft Word report

Matt T suggests: “Perhaps this video on how to use nesting repeaters will help. I can’t say that I’ve watched it.” 

Ian is pleased: “I got this to work based on this video. I will post back what I did just in case anyone is curious. To get a nested repeater to work, all you have to do is create a ‘brand new’ Word table underneath the parent line with only one row. My mistake was that I thought it had to be connected to the parent line somehow, so I was creating a new row within the same table as the parent line. You just need a new table underneath. Then, highlight the entire row of the new table and right click the nested repeating line from XML Mapping and choose Repeating -> Insert Content Control. Once you do that, you can add all fields from that line. It works!  Matt, thanks for pointing out the video.” 

Kyle asks: “As a discussion point, why are you doing this layout in Word rather than RDLC?” 

Ian replies: “They are integrating their reports with the Microsoft Dynamics 365 Credit Card Processing | iSolutions Payments product. The base reports it comes with contain a clickable link where they send the Word document version of a sales invoice to the customer, and it contains a link to click and pay via credit card. Those documents work fine, but they wanted that link in their own, custom documents. As far as I know, this cannot be done in RDLC. I got it to work in the Word versions of their reports, so all good.” 

Learn more about development in Microsoft Dynamics NAV and Dynamics 365 Business Central by selecting the “Developer” category on our blog page.

Trending Posts

Stay Informed

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