Scanner (barcode), compare between two Table(fields)
Hi, I 'am trying to use the scanner to check-in and -out products from my inventory by scanning the serial number barcode on the products. So I have three tables: "Product" > Sub-table: "Serialnumbers", they are linked to a table : "Rental". On the table Rental I have a button with this code:
let code := barcodeScan();
let serialnb := concat(Product.Serialnumbers.'Serial number');
let serialchk := contains(seriecnb, code);
if serialchk = true then
'copytohere' := code;
else
void
The problem is that if the serial number is: 123456 and the scanner has 1234 it will still check it as good.
My question is which code I should use for "exactly match" of the fields?
Thanks
11 replies
-
Instead of assigning the comparison to a variable and instead of using contains(), let the conditional statement handle the comparison...
if code = serialnb then
copytohere := code
end
contains() does check for an exact match within the string, but does not do an exact string to string comparison.
-
Hi Sean, Thanks for your reply! The code is not working, I guess because "Serial number" has many records?
-
I see what you're saying. Does concat(Product.Serialnumbers.'Serial number') create a string with all of the Serial Numbers? Maybe another possibility would be...
if (select Serialnumbers)['Serial number' = code] then
copytohere := code
end
I am unable to test this, but the idea is to test for a match using select and filter. I'm about to call it a night so I won't be able to respond until the morning here.
-
If I try with "select" then it will check every serial number as "good" (copytohere := code) even if the serial number is wrong. And yes, if I use "concat" it will list them separeted bij a comma and a space
-
This should work...
let serialchk := (select Serialnumbers)['Serial number' = code];
if serialchk != "" then
copytohere := code
end
-
Yes it's working now! You are great!!! Thank you so much!!!
-
LOL. Mass, you’re welcome and I’m glad it’s working for you.
-
Hello,
I would need some help with this. I have a table STORAGE CLIENTS and every record has it“s own barcode/unique serial number.
I need, once our clients come back with their printed recepits, to scan the barcode and change the status of the record from IN STORAGE to CHECKED-OUT. I tryed playing around with the previous example but didnt have any luck. Can someone help?
What i did try is to create a new table with a button (as descrbed above) but can”t really get it to work. I need the system to simply change the status of the corresponding record once the barcode is read.
Thanks for any help!
-
if the status of your table is a text field it should be something like:
let code := barcodeScan();
let serialchk := (select Serialnumbers)[“Serial number” = code];
if serialchk != “” then
“your status field” := text(“checked”);
endfor testing if your button is working anyway you could add:
else
“your status field” = 0; (or whatever you want to put there)
-
the status of the record is a choice field
-
I belive the code i set is wrong
let code := barcodeScan();
let serialchk := (select “Storage Clients”)[“Unique Code” = code];
if serialchk != “” then
(select “Storage Clients”)[“Payment Status” = 3]
endobviuosly the change has to be applied only to the correspoding record..
Content aside
- 4 yrs agoLast active
- 11Replies
- 2575Views