Barcode to Show Stock Item

I have a Barcode Column in Stock Item Table which has Barcode and Stock Item Name.

I have Orders Table and in the Orders Form I have Order Date then Barcode Column which is Ref type and it refers to the Stock Item Table. I want to automatically Select the Stock Item when the user Scans the Barcode but for some items which don’t have a Barcode the user should be able to manually Select the Stock Item as well.

Please let me know how to do this.

Thank You!! :blush:

Hi @Total_Solutions

In the initial value field:

IF(
     ISNOTBLANK([Barcode]),
     [related item].[current stock],
     0
)

Let us know if that helps

2 Likes

I did not understand where to put this formula you gave. In the Barcode Column or in the Stock Item Column. Also please give formula depending on my Table Structure as I am getting confused!!

Attached Orders Table, Stock Item Table & Orders Form.

The Barcode and Stock Item Table are Ref. columns both referring to the Stock Item Table.

Please advice. Thank you!! :blush::pray:

Hi @Total_Solutions

Sorry I did not see your answer :sweat_smile:
Did you find out the solution ?

If you want to ping me, please use the @ with my name, this way I will be notified :slight_smile:

In the initial value field:

This is a property of the column.
Here, it should be the Initial Value from your column Stock Item.

No its not working…
IF(
ISNOTBLANK([Barcode]),
[related item].[current stock],
0
)

I put it as below:
IF(
ISNOTBLANK([Bc]),
[Bc].[SIName],
0
)

Is the above correct?

In the StockItem Table the Label is the Stock Item Name (SIName) so if I put a ref in Barcode Column it shows the Stock Item Names not the Barcodes but I need the Ref to the Stock Item Name as many of my Service and AMC Stock Items don’t have a barcode so i need to select them from the Dropdown of the SIName.

OR

Should I keep the Bc (Barcode) column as text type column and I have a Stock Item Name (SIName) as a Ref. Column referring to the StockItem Table.

If the Barcode is entered and if the corresponding product is found it should show it in the SIName column otherwise it should let us select it from the Dropdown list of SIName.

Hope you got what I am trying to say.

Ok, I think I got it.
In that case, you should use another column as a key_column (lets’s say ID_column, with Initial Value formula : UNIQUEID()), and keep your SIName column as Label.
Please check your Bc column has Searchable option enabled.

I can’t keep SIName as Label as if the Barcode is not found we have to Select the StockItem from the dropdown list of the SIName.