Saturday 6 February 2021

Print and attach report to documents

 

You can now print document related reports and add them as attachments to a document itself. This is particularly helpful if your document goes through many versions that you want to keep a track of.

  1. Create a sales quote of 100 bicycles for a customer. There is Attachment factbox to navigate to any attached prints.

2. Release the quote. Navigate to Print/Send -> Attach as PDF. The sales quote report is printed by default and attached to the quote document

Drill down on the attachment to view it

When you convert this quote to order you see that it is also attached to the new order document. Now change the order qty or any other field in the document and save this version of the order confirmation to the order.

When you click Attach as PDF on the sales order you see a list of options because there are those many reports that can be printed and also attached to the order.

Search Pages in Business Central

 Menusuites are old age now with Business Central.

Pages have now come with a new property that makes them found on searching in your client.

The property is UsageCategory with values as below. The values replicate every behavior like the previous Menusuite.

NoneThe page or report is not included in a search.
ListsThe page or report is listed as Lists under the Pages and Tasks category.
TasksThe page or report is listed as Tasks under the Pages and Tasks category.
ReportsAndAnalysisThe page or report is listed as Reports and Analysis under the Reports and Analysis category.
DocumentsThe page or report is listed as Documents under the Reports and Analysis category.
HistoryThe page or report is listed as Archive under the Reports and Analysis category.
AdministrationThe page or report is listed as Administration under the Pages and Tasks category.

Reset credentials to extension

 I accidentally created my AL project using wrong credentials, which gave me a nightmare publishing it. I wanted to tell the AL project to please forget my previous login and ask me for a new one.


The trick is to clear cache of your previous credentials. Press Ctrl + Shift + P to open up the command pallet and search for clear credentials. Select the one.

Try to publish your app again and it asks for you to enter the credentials again.

Save your Symbols in a common folder using Package Cache Path

When you typically try to create a new AL Project, unless you already have done the changes mentioned in this post, you would need to download symbols for the base application for your AL Project. Doing this would then create a new symbol files attached to your project

And this can also be seen in your folder for AL Project

If there are many such sub projects you have created for say a larger project, you might not want to create and save these symbol files in each sub project folder. More so when they all need to refer to the same symbols collection.

One way of doing this is via a User setting. Open your VS Code and navigate to user settings.

GO TO Extensions -> AL Language Extensions and scroll down to the property Package Cache Path. This is where you need to set the path where symbols should be downloaded to and referred from every AL project you create.

The project was compiled successfully.

Remember this is a user setting and so is only specific only to your user. When deploying extensions, this needs to be taken care of. This can be done adding this folder to your project. Select File -> Add folder to your workspace. Select the symbols folder you created.