Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4036 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello Board!

 

We use FM12 to log products that are being packed.

 

Each product has a unique barcode number of 10 digit numbers. No one is the same.

 

We scan them into a field and print a label. There is an Auto-Validation 'Unique' parameter on that field.

 

However, now, we need to have some of those products returned, rechecked and then resent out to other customers.

 

What I want is a script that gets the Barcode Number, checks it against the QC table, if the number is not there, it enters it; if it is there, it checks our 'Returns' Table and then accepts it. If it is in the QC table but not in the 'Returns' table, i need it to 'Error' in some way.

 

Can you help direct my thought on how to solve this?

 

I'd like a Custom Dialog Box to pop up, requesting the Barcode number. Our scanners would be programmed to hit 'enter' after the scan - so the barcode would be entered and then 'OK'd.

 

FM would make that Barcode number a Variable and search the QC table for it. 

 

I don't know how to make an action happen based on a find, though.

 

Am i thinking about this correctly?

 

How do i get an action to happen depending on what is found? As above, if nothing is found, it continues with the script (printing a label, entering a timestamp, adding a new record, brining up the CustomDialogBox again). If it is found, it then checks another table and if it's there (in the Returns table and has a Returns::Status=Passed status, as a suggestion) it then continues with the script. But if it's in the first QC table but not in the Returns Table, it errors???

 

Thanks for any guidance you can give me!
 

Harry

Posted (edited)

IMHO, it would be best to scan the barcode into a global field first, and use relationships to the two tables to see if the scanned number has a matching value in either one. Then have the script proceed accordingly - i.e. if no match is found or a match is found in both tables, create the record, otherwise throw an error and start over.

 

 

But to answer your question regarding the find: you can use the Get ( FoundCount ) function to determine how many records (if any) were found. You should also set error capture on before performing the find, because a found count of 0 is an error, and you want your script rather than the user to handle it.

 

---

 

it then checks another table and if it's there (in the Returns table and has a Returns::Status=Passed status,

 

Is it possible for a product to be returned more than one time?

Edited by comment
Posted

Hi Comment, 

 

Thanks for your input.

 

Yes, it is possible to have a product returned more than once. We've not had that while running this new system, but it certainly is possible.

 

So to check the first QC table, do i self join to a copy of the QC table and then enter Search Mode to run a Search?

 

I have a DialogBox appear and the barcode number is zapped into it, a Global Field. Then I set a Variable $$Barcode as that data, then enter SearchMode and search for that variable. Then do a Count and if the Count is 1 or more, do the same search in the Returns table, if that count is 1 or more, proceed to the label printing?

 

If it is 1 or more in the first table but not in the second, it clears the field and asks for another Barcode number.

 

and

 

If there is no record, it proceeds to the label printing.

 

Is that the gist of it, so it's clear in my head? I've not done much IF statement or scripting before with variables.

 

Thanks,

 

H

Posted

So to check the first QC table, do i self join to a copy of the QC table and then enter Search Mode to run a Search?

 

Ahm, the idea is to use relationships instead of performing finds. Say you have these two relationships in place:

 

SomeTO::gBarcode = QC::Barcode

QC::Barcode = Returns::Barcode

then from the context of SomeTO you can tell immediately if related records exist, for example by =

 

IsEmpty ( QC::Barcode ) or not IsEmpty ( Returns::Barcode )
Yes, it is possible to have a product returned more than once.

 

Well, then it's a bit more complex than that, isn't it? I mean, based on what you said earlier, shouldn't you be looking at the status of the last matching entry in Returns?

Posted

Yes, it is possible to have a product returned more than once. 

 

However, now, we need to have some of those products returned, rechecked and then resent out to other customers.

 

I do not understand how this can happen; forgive me if I am out of line in asking but if a product is sold and then returned, it should apply against the LineItem product sold and negate credit the transaction.  It could only be returned AGAIN if it is first sold again, no?  You cannot return a product without a sale to apply it against or do you accept returns from other stores where there was no original sale? If it's the case that there must be a sale before there can be a return then the second return would apply against the LineItem of the SECOND sale not the first.

 

Just something to consider. :-)

Posted

THank you all for your input.

 

Firstly - that Status is the key to what i'm trying to do and has unlocked my thinking - the 'IsEmpty' or 'IsNotEmpty', fantastic, thanks.

 

I can link the Two tables on the Barcode field and then search in one, if the other is there, proceed to a different step etc etc. Cheers.

 

In answer to your question, LaRetta, i use the idea of 'Sales' as an easy way to communicate my idea. It's really a 'shipping out' procedure. So, two products might be shipped out - they must be on a shipping note before they can be packed. One my be charged for and the customer returns one they don't want. The other comes back under and RMA number, which it must have to go into the Returns, so then a WO is produced to get it through the QC procedure. The 'other customer' is, in effect, a shipping number i guess in my case.

 

Sometimes, though, products are so old, they may have been passed down to someone or sold second hand and be returned for repair several times; each time going back somewhere different.

 

These are rare occurances, but i'm trying to figure it out in a really simple way, so all and any eventualities are covered by some manner.

 

Thanks again for your input.

 

I have solved a few problems today and moved forwards. 

 

Can I ask now, i need to print certain labels off - different per product.

 

Is this a good way of doing it (written in Notepad):

 

 

Go To Layout [Ean13Label]

Set Variable ($$CountEAN13=0)

Loop

Exit Loop if [$$CountEAN13 = product name::product_ean_13_label_quantity]

Print [No Dialog]

Set Variable [$$CountEAN13 +1]

End Loop

Go To Layout [uILabel]

Set Variable ($$CountUILabel=0)

Loop

Exit Loop if [$$CountUILabel = product name::product_UI_label_quantity]

Print [No Dialog]

Set Variable [$$CountUILabel+1]

End Loop

Go To Layout [Original]

 

I found a few examples of this - making a loop happen a certain number of times, is this the 'correct' way?

 

Thank you again!

 

H

Posted

You shouldn't be using global $$variables unless you require them to persist after the script has run out. Otherwise use script $variables that expire when the script exits - which also means you don't need to initialize them, e.g.
 

Go to Layout ["Label"]
Loop
Set Variable [$i ; $i + 1]
Exit Loop If [$i > Products::Label_quantity]
Print [No Dialog]
End Loop
Posted

Great, OK, just read up on Variables again and I understand now. Much nicer, thank you.

This topic is 4036 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.