Dynamics NAV / Business Central Developer Digest - Vol 371

Dynamics NAV / Business Central Developer Digest - Vol 371

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central development and Dynamics NAV development. In Developer Digest Volume 371, we discuss merging PDFs, issues with RDL reports, job queues, 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 great information with everyone who might not have the time to check out the multitude of resources out there?

So, the ArcherPoint Microsoft Dynamics NAV/BC 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.

Merging PDFs Into One Document

Ed shares his task, looking for assistance: “I have a customer for whom I developed five export print documents. For most exports, all five documents are needed, for some others maybe just three or four. Initially just the printed versions were sufficient, then print to PDF. The PDF requirement grew to all five; sometimes four documents need to be merged into one PDF document. I did a preliminary search and BullZip, PDFSharp and a product called PDFMerge offer some promising solutions. Before I pursue those further, has anyone automated running multiple reports to PDF and then merging into one document?”

Kyle is curious: “Why do they need to be merged into a single PDF?”

Andrew offers Denise’s expertise: “I believe I saw a case where Denise Blaisdell did this for a customer—combined posted sales invoices and credits together in one document and emailed it. And yes, there was a third-party product used.”

Ed replies: “Thanks for the help. The customer decided five separate attachments would work better. Denise accomplished the merge with PDFTK. I ended up creating a new function in the mail codeunit called CreateAndSendMessageMultiple. Pass in an array of up to five document file names.”

Mail codeunit CreateAndSendMessageMultiple Business Central
Figure 1 – Mail codeunit CreateAndSendMessageMultiple for merging PDFs in Microsoft Dynamics 365 Business Central

Andrew says: “Thanks for attaching the code, I’ll keep this for later.”

RDL Report Working On Premises But Not On SaaS Version Of Business Central

Herman asks: “Good afternoon, fellow developers! Do you have an idea for the following problem? An RDL report works fine on-prem but shows blank on SaaS. Action ’Send to …’ with option ‘Microsoft Excel Document (data only)’ works fine on SaaS producing Excel with the rows. Action ‘Send to …’ with option ‘Microsoft Excel Document (data and layout)’ produces blank Excel on SaaS. Maybe you confronted this problem in the past. I will be very thankful for your help.”

He then follows up: “Thank you. Looks like we found the problem – incorrect referencing RDL.”

Job Queue Issue In Business Central

Sam inquires: “Hi All. I have an odd Job Queue issue and wondering if anyone has encountered something similar in the past. The customer has a Job Queue running a codeunit every 60 minutes, 24 hours a day, every day of the week. Recently, the job que has stopped running at a similar time in the night, usually between 11:45 PM and 12:00 AM. What is strange is that there is no error in the log. The Job Queue will just stop and go into an error state without the actual error. We suggested that the user stop the Job Queue from running at 11 PM and start the queue at 1 AM to see if that would help. It seems to have worked for the most part’ however, there are some days where the Job Queue still stops. I have looked in the SQL event log and saw errors at a similar time from where the Queue stopped, but they did not seem to be of any significance. Anyone have any ideas?

Kyle asks: “What is in the Event Log on the server running the BCST? There is probably an error logged about the time of the failure. What version of BC?”

Sam responds: “BC14. There was an error in the event log around the same time for an unrelated codeunit. However, the same error appears multiple times throughout the day and does not cause the codeunit to stop. It is only stopping in that specific time window between 11:45 PM and 12 AM.”

Kyle comes back with more questions and thoughts: “Many questions and thoughts. What time does the nightly SQL backup happen? Is that running successfully? I struggle to see how the JQE could go into an error state without either an Error (Show Error) or an event in the Event Log. The Event Log to check is on the server hosting the service tier, not the SQL server. Is it AL or C/AL FOB? Is the Job Queue running in a separate service tier, meaning no users? Is this problem reproducible in a Test database? You can DM me the codeunit; I’ll take a look and see if I notice anything obvious. You should be able to have the job skip a window of time. Set the Start Time as 01:00 and the End Time as 23:00, and then have it run every 15 minutes.

Interested in Dynamics NAV and/or Business Central development? Be sure to see 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
Last Name
Subscription Options
Your Privacy is Guaranteed