SBX - Search With Button

SBX - Forum Post Title

Barcode integration

Microsoft Dynamics NAV Forum

Christopher007 asked a question on 13 Apr 2016 6:10 AM
My Badges

Question Status

Verified

I am working on integrate a barcode solution.

Currently I have made the piece that creates the barcode, print out the label on a report.

Now I am at the point where when creating a sales order you should be able to place the cursor in the "No." feild on Sales Order lines (Sales Order Subform) and then you should be able to scan a barcode and it will read it.

The barcode is created from the code is from the table Item Identifier (7704) which also have item no.

Do somebody got a suggestion how to approach this? 
I was thinking about creating a new colonn in the Sales Order Subform where you can use the scanner and then it will do some validation and enter the item information as it would if you just typed in Item No.

Reply
Alexander Ermakov responded on 13 Apr 2016 6:32 AM
My Badges
Verified Answer

You do not need to add new field in Sales Order Subform lines itself. As I understood, you already have the barcode field in the item card. Thus, you need to add this field in the drop-down menu of the Item No. field in the Sales lines, and setup it as a default search field. Thus, when reading a barcode, you will automatically get the correct item into the line.

How to achieve modification of drop-down list: in the development environment, design Item table, and go to View->Field Groups; for the DropDown property, add needed field with a barcode code.

Reply
Christopher007 responded on 13 Apr 2016 6:41 AM
My Badges

Yeah, that what i thought to start with, but what if the user what to type in the Item No. then he needs to switch the default search field. Thats why i wantet to create a new field so that the user can both type in Item No. manually or use the scanner to scan a barcode.

The barcode have another number than the Item No.

Reply
Alexander Ermakov responded on 13 Apr 2016 7:03 AM
My Badges
Suggested Answer

Dropdown fields with a search field selection are designed exactly when user wants to find item by various parameters - code, name, default dimension value, etc. Next time users will tell they need to enter item by name, the other time - by supplier barcode, etc. You can't follow such requests and add more and more fields on the sales line :-). I actually do not see a major problem for the user to switch between search fields as it is just a one or two mouse clicks. Having this in place, you will use standard functionality and do not need to develop anything, which to me is always much better.

Do your users really have such a process when they constantly need to switch between entering by Item No and by Barcode scanner within the same document for different lines?

Reply
Alexander Ermakov responded on 13 Apr 2016 7:39 AM
My Badges
Suggested Answer

If you really-really think that adding a new field to Sales Line is inevitable, then you would need to create this new field, put it on the form and on the form write a piece of code in OnValidate trigger that would search for the item card by barcode value, get the Item code and write it to Item No. field. Here you would need to think what will you do if your function will find more than one item card with the same barcode (which for sure you will face some time after :-) ).

Using standard functionality as I described earlier, users will get in the dropdown list two or more items and this would be their responsibility to identify the proper one; or, they would be aware that there are more than one item and can do something.

Reply
Christopher007 responded on 13 Apr 2016 8:32 AM
My Badges

Ok great with some good tips - I will go with your suggestion then.

Next problem - the Identifier Code in Item table is a flowfield and flowfields cant be keys which means i cant seach on Item Identifier.

Should I switch it to normal field and then in TableRelation -> "Item Identifier"."Item No." WHERE (Item No.=FIELD(No.))

I tried to do that, but didnt get the resault i wantet.

Reply
Vishal Salot responded on 13 Apr 2016 9:28 AM
My Badges
Suggested Answer

You might face some issues, if you change the standard field type..

1) Actually, Item Identifier is getting displayed at Item Card due to Flow field. If you change field type to normal, you need to also write the logic to update the Item Identifier at Item Table based on some event.

2) Standard functionality might get affected, if you change the same

3) Just In case, if you have multiple Item Identifiers (Barcodes) against same item, you might face some issue

4) Scanning Barcode may not be that convenient from the drop down option. You can still look for that option, if convenient to users.

Alternatively,  as you were thinking initially, you can create new column "Barcode No." in Sales Line, Scan the Barcode directly and fetch the Item No. from Item Identifier table and validate the Standard Item No. field in Sales Line Table.

This might be the simplest and easier from user perspective.

Reply
Christopher007 responded on 14 Apr 2016 4:25 AM
My Badges

Thanks Alexander Ermakov and Vishal Salot, I got it to work wiht Alexander's solution.

I got a related question - Is it possible to make it filter in multiple fields?

Ect. you scan barcode in the field and it searches for barcode No. but you can also type in Item No. without changeing search column, and describtion?

Like a search that will just search in anything?

Reply
Khoa Nguyen responded on 14 Apr 2016 5:32 AM
My Badges
Suggested Answer

Hi Christopher007,

I think you don't need to do any customization for this. Item Barcode is standard function. Hope these links are useful: www.archerpoint.com/.../setting-item-cross-reference-customers-and-vendors and www.youtube.com/watch

Reply
Alexander Ermakov responded on 13 Apr 2016 6:32 AM
My Badges
Verified Answer

You do not need to add new field in Sales Order Subform lines itself. As I understood, you already have the barcode field in the item card. Thus, you need to add this field in the drop-down menu of the Item No. field in the Sales lines, and setup it as a default search field. Thus, when reading a barcode, you will automatically get the correct item into the line.

How to achieve modification of drop-down list: in the development environment, design Item table, and go to View->Field Groups; for the DropDown property, add needed field with a barcode code.

Reply
Alexander Ermakov responded on 13 Apr 2016 7:03 AM
My Badges
Suggested Answer

Dropdown fields with a search field selection are designed exactly when user wants to find item by various parameters - code, name, default dimension value, etc. Next time users will tell they need to enter item by name, the other time - by supplier barcode, etc. You can't follow such requests and add more and more fields on the sales line :-). I actually do not see a major problem for the user to switch between search fields as it is just a one or two mouse clicks. Having this in place, you will use standard functionality and do not need to develop anything, which to me is always much better.

Do your users really have such a process when they constantly need to switch between entering by Item No and by Barcode scanner within the same document for different lines?

Reply
Alexander Ermakov responded on 13 Apr 2016 7:39 AM
My Badges
Suggested Answer

If you really-really think that adding a new field to Sales Line is inevitable, then you would need to create this new field, put it on the form and on the form write a piece of code in OnValidate trigger that would search for the item card by barcode value, get the Item code and write it to Item No. field. Here you would need to think what will you do if your function will find more than one item card with the same barcode (which for sure you will face some time after :-) ).

Using standard functionality as I described earlier, users will get in the dropdown list two or more items and this would be their responsibility to identify the proper one; or, they would be aware that there are more than one item and can do something.

Reply
Vishal Salot responded on 13 Apr 2016 9:28 AM
My Badges
Suggested Answer

You might face some issues, if you change the standard field type..

1) Actually, Item Identifier is getting displayed at Item Card due to Flow field. If you change field type to normal, you need to also write the logic to update the Item Identifier at Item Table based on some event.

2) Standard functionality might get affected, if you change the same

3) Just In case, if you have multiple Item Identifiers (Barcodes) against same item, you might face some issue

4) Scanning Barcode may not be that convenient from the drop down option. You can still look for that option, if convenient to users.

Alternatively,  as you were thinking initially, you can create new column "Barcode No." in Sales Line, Scan the Barcode directly and fetch the Item No. from Item Identifier table and validate the Standard Item No. field in Sales Line Table.

This might be the simplest and easier from user perspective.

Reply
Khoa Nguyen responded on 14 Apr 2016 5:32 AM
My Badges
Suggested Answer

Hi Christopher007,

I think you don't need to do any customization for this. Item Barcode is standard function. Hope these links are useful: www.archerpoint.com/.../setting-item-cross-reference-customers-and-vendors and www.youtube.com/watch

Reply

SBX - Two Col Forum

SBX - Migrated JS