Introduction:

Summary:

The bar code scanner scans the bar code. The Item No. against which the bar code is assigned should be populated on Sales Line Subform.

Requirement:

  1. The mouse cursor is on Sales Line sub form field No. and Bar code scanner scans a bar code.Once the bar code is scanned a Serial No. is populated on No. field of Sales Line sub form
  2. Customization should be done to fetch against which Item No. in Business Central  the Serial No. is assigned. The No. field in Sales Line sub form is replaced with the Item No, Location and Quantity from Item Ledger Entries.
  3. If the Item No is already present and cursor is again on the No. field and Bar code scanner scans again then the quantity will be plus 1

Pre-requisites:

  • BarCode Scanner
  • Business Central
  • Bar code generated for Item No.

Steps:

  1. Open Items page, assign Item Tracking.

1

2. Create a Purchase Order and assign Item Tracking Lines and post them. Here Item tracking Lines is assigned against Item No 1000

2

3. Now generate Bar codes for these Serial Nos. using Online tools.

4. Copy the bar codes to a word document and take a print out. Below is a copy of word docx.

Barcode

5.  Below is the code attached to fulfill the requirement

3

4

Here code is written on AfterValidate trigger for Location code because on validation of No. field the Location of subform is assigned the Location code of  Header.

6. Open Sales order and keep your cursor on No. field of Sales Line sub form. Scans the bar code

5

6

Happy Weekend!

8