0

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

null
    • Sean
    • 5 yrs ago
    • Reported - view

    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.

    • Mass
    • 5 yrs ago
    • Reported - view

    Hi Sean, Thanks for your reply! The code is not working, I guess because "Serial number" has many records?

    • Sean
    • 5 yrs ago
    • Reported - view

    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.

    • Mass
    • 5 yrs ago
    • Reported - view

    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

    • Sean
    • 5 yrs ago
    • Reported - view

    This should work...

     

    let serialchk := (select Serialnumbers)['Serial number' = code];
    if serialchk != "" then
    copytohere := code
    end

    • Mass
    • 5 yrs ago
    • Reported - view

    Yes it's working now! You are great!!! Thank you so much!!!

    • Sean
    • 5 yrs ago
    • Reported - view

    LOL. Mass, you’re welcome and I’m glad it’s working for you.

    • CLD
    • Valerio
    • 3 yrs ago
    • Reported - view

    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!

    • Mass
    • 3 yrs ago
    • Reported - view

    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”);
    end

    for testing if your button is working anyway you could add:

    else

    “your status field” = 0; (or whatever you want to put there)

    • CLD
    • Valerio
    • 3 yrs ago
    • Reported - view

    the status of the record is a choice field

    • CLD
    • Valerio
    • 3 yrs ago
    • Reported - view

    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]
    end

    obviuosly the change has to be applied only to the correspoding record..

Content aside

  • 3 yrs agoLast active
  • 11Replies
  • 2566Views