Skip to main content

#bcopendiscussion - Dummy Extension for Print Custom Report From Purchase Order.

 Hi Readers,

This article is originated from one of our weekly #bcopendiscussion. This article talks about a concept you can enhance this extension the way you wanted. 

I have two other way that I can handle it, so feel free to add your views in the GitHub repo. 

If you find this useful please thanks  Shahid Ullah.


The discussion question was - 

I like to replace the existing Purchase Order Report with my Developed Purchase Order Report using the below condition-

I have added a filed Order Type and Value is say 1,2,3

If Order Type 1 then like to call Custom PO report ID-50001

If Order Type 2 then like to call Custom PO report ID-50002

If Order Type 3 then like to call Custom PO report ID-50003

Here is how I thought would be simple extension for it -

1. Add a Field in Purchase Header Table and Purchase order Page.

Using Table Extension add a field & using page extension add field in General Tab.

** Just for Demo I am using SDH Prefix/Suffix.

2. Add a Codeunit To Subscribe Event from Table Report Selection.

Check it is purchase order or not. If its not purchase order then exit otherwise call customize report.

3. Add Reports that you need. 

For Demo I just copied base Microsoft Report and saved in 5000 Numbers.

4. Test Process, Check Purchase order and check with Order Type = ''.

5. Test Process, Check Purchase order and check with Order Type = option2.

If you find this useful, or would like to enhance this please feel free to download / contribute using GitHub repo.

GitHub Link -

If you are still in C/AL please download objects from here. OneDrive Link

Source code is developed using Business Central 14. You can branch out and download symbol to test it. When you will try to download symbol system will generate launch.json.

Let me know your views on same.

Saurav Dhyani


Post a Comment

Popular posts from this blog

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

Dynamics 365 Business Central 2021 release wave 2 (BC19) Released.

Hi Readers, As we all were expecting Microsoft have Released Business Central 2021 Release Wave 2 Today a.k.a BC19. In this article we will see what all is announced with the General Availability.  Starting Today Customers & Partners can start using Business Central 19. #msdyn365bc #bc19

Navision Cannot generate SSPI context State ID HY000

Hi all, Sometime while trying to connect database in classic client with windows authentication or connect to Role Tailored Client we face an error message. Error - The following ODBC error occurred: Error: [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context  State ID: HY000