D365 Business Central – How to work with “Lot No.” in Business Central
In today’s blog, we are going to discuss about “Lot No.” feature in Business Central and how to assign the Lot No to newly created Item and cerate Purchase & Sales transaction.
The very first step is to create an Item in the Item Master.
- Go to Item List page in Business central.
- Select New from the Action.
3.Select ITEM TEMPLATE
- Fill the Description field and Type field should be Inventory, here I’m using item name as Bottle.
- In the same Item card page under Item Tracking section, select LOTALL for Item Tracking Code field.
After this go back and check the item list, our new item will have been created.
The second step is to create a Purchase Order for the newly created Item
- Go to Purchase Order in Business Central
- Select New, fill the required fields.
- Under Lines
- Select the newly created item, fill required fields remember to specify the Location Code.
3.In Line action select Item Tracking Lines, item tracking page will open.
4.If the Lot No is already specified in the Item page, specify the quantity, and go to Process action select Assign LOT No.
5.If not, in lines create LOT No. and assign the quantity.
6.LOT No. are created based on the quantity assigned in the purchase order.
7.For example: – For the item Bottle, if we specify the quantity as 5 single LOT No. is created for all the 5 quantities.
Or we can create two more LOT Nos by distributing quantities between those two Lot Nos as shown below, but quantity should not exceed the original quantity.
8.Close and Post the Purchase order.
9.Now in the inventory we have Bottle of quantity 5 reserved and can be identified by the Lot No given.
10.Suppose if we want to sell those reserved quantities, Sales Order should be created.
The third step is to create a Sales Order for the newly created Item
- Go to Sales Order
- Select New, fill the required fields
- Under Lines section, select the newly created item and fill the required fields
- In the lines fill Location code same as posted purchase order. For example: Suppose location code in purchase order is Main it has to be same for sale order.
- Under Lines section, go to Related Information, under that select Item Tracking Lines.
- Select Entries a page will open, select the LOT No. and then click OK.
- Come back from Item Tracking Lines page
- Now Lot No. is allotted for the item, and we can post the Sales Order.
For more details kindly visit our linkedin page:
https://www.linkedin.com/company/allgrow-technologies-pvt-ltd/mycompany/
By Vinyas. S.
Business Central-Understanding FlowFields
Overview
FlowFields are the fields which are used only to display the result of a calculation based on the “calcFormula” property. They are not the physical fields, as they do not store any value in the database. Interestingly, the values in the flowFields exists only at runtime. By default, the flowfields are initialized to 0. There are seven (7) types of flowFields, namely, sum, average, exist, count, min, max and lookup.
We define a flowField by defining the fieldClass property as FlowField and giving the calcFormula property as per our requirement.
Below, we have defined a flowField, “Name”, which is used to display the name of the customer. Here we have created the flowField of type “lookup”.
When the FlowField is the direct source of expression of a control on page, then FlowField is updated automatically based on calcFormula property when the page is displayed.
Now, if a flowfield is initialized to 0, how do we update the value of that flowfield? The answer to this question is using CalcFields Method.
Let us learn about the calcFields method.
CalcFields
This method is used to update the value of a flowfield. As we know that FlowFields have calcFormula property. CalcFields use the current filters and perform the calculations defined in the calcFormula property and updates the value of the flowField.
Let us make use of this calcFields in our code,
- We will define a procedure which shows us balance (flowField) of a customer.
- Firstly, we will use Record. Get () method to retrieve the record from customer table, based on the primary key field.
- Now the balance is a flowField, If we don’t update it (without using calcFields) then it will show the balance as 0.
CODE: –
OUTPUT: –
- So, we will use the calcFields method for updating the value of this flowField.
- Now Balance has some value to display, based on calcFormula.
- We will now use message () to display the Balance.
CODE: –
OUTPUT: –
For more details kindly visit our linkedin page:
https://www.linkedin.com/company/allgrow-technologies-pvt-ltd/mycompany/
By Harshit. T.
How to create Barcode Report in Business Central
Let’s see how we can create a Barcode Report in Business Central!
So, what is a Barcode?
Barcodes are the labels, used to display information related to products. Barcode consists of two key components: Barcode provider and encoder.
Barcode provider includes different fonts and symbology available for use and Encoder are components of the provider that encode the data strings of a report dataset to a specific font specification and symbology.
How to create Barcode report!
Create a new report, if you don’t know no how to create a report please refer my previous blog I have explained how to create a report.
In “OnAfterGetRecord” trigger:
- First create “Barcode Font” variable of type “interface”, “Symbology” variable of type Enum and “String” variable of type Text.
- Assign value for Barcode Font variable, specifies which Font has to be used, Example: “IDAutomation1D”
- Assign value for Symbology that specifies variable length barcode that can be encoded, Example: Code 39 (consist up to 43 alphanumeric character)
- Assign the value for variable “String”, which specifies which string needs to be converted into a barcode.
- Create a global variable of “Text data type” and pass the value to it by encoding the String and Symbology value.
This is how it looks.
Save the report, then design the RDLC layout, refer my previous blog to know how to design the layout.
Right click on the EncodeText variable in the layout click on “Text Box Properties” click on “Font” specify the Font as IDAutomationHC39M, then click “OK” save the report and close it.
Run the report in VS code, Business central page will open search for your report and then click on the “Preview” action.
Result of the report will look like this.
For more details kindly visit our linkedin page:
https://www.linkedin.com/company/allgrow-technologies-pvt-ltd/mycompany/
By Manasa. D.
How to create a Report Extension to add a field to the dataset of a Report
Overview
In the report extension, you can extend existing reports, similar to tables and pages.
Some of the features in the report extension –
Adding columns to the existing Dataitem.
Adding new Dataitem.
Adding a new layout file which reflects with new fields of report extension.
Adding fields in the request page.
For instance:
Let’s add a field in the Sales Invoice NA report 10074.
Add a field [HalfQty] in the existing report.
First, we need to create new “al file” for report extension. In the file, we can use report extension snippet “treportext” to create report extension object.
Then we give ID and NAME for our report extension object and add a field [HalfQty] in the dataset.
Report extension layout:
Next step is to add a layout file to the report extension. Because when we add the property [Rdlc Layout / Word Layout] to report extension, then it automatically creates a layout file of report extension, which will be empty, so we will not use this recreated file, but instead we will use a base layout file.
So, how to find a base layout file!
We need to go to “Business Central” and search the “Report Layout Selection” page and then filter it on “REPORT ID[10074]” as shown below.
Now we will add a new “Custom Layout” for the report, that’s a copy of Built-In Layout (Same as shown in below):
Click on the “Custom Layouts” and Open the Page then select the “New”.
Once when we click on “OK”, It will Create a copy of Build-In Layout. (As shown on above).
Now we can “Export” it (As shown in below).
Then file [.rdlc] is download and now we need to the move exported file [Copy of Build-In Layout] in our Vs-Code project folder and rename it to “SalesInvoiceNAExt.rdlc” (As per choice):
And now we are adding our field in the layout file. So, we will Compile “Ctrl+Shift+B” in the project, then new added field “HalfQty” in the dataset of the report extension will also be added in the rdlc layout.
When we open the rdlc layout in Vs-Code, we will have the updated dataset and Copy of Build-In layout:
Next, we need to publish the project [App] in BC.
Update the New [Copy of Build-In] Layout in Business Central:
Now we will again open the “Report Layout Selection” page and deploy our new layout in Business Central.
Go to “custom layout page” then “Import Layout” and after import then Update it (as shown in below):
After updating, the layout is showed in the page, set this layout as a default layout in this page because the layout of report extension is not updated automatically.
Always make sure to choose “Default Report Layout”, once done, then test it.
For more details kindly visit our linkedin page:
https://www.linkedin.com/company/allgrow-technologies-pvt-ltd/mycompany/
By Aditya. D.