Jump to content

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

Recommended Posts

Posted

Hi, I design a database for purchase product.My problem is: I want when receive a product, click on receive field and open receive layout (related with purchase and product), and I can enter date of receive and qty of product,

and

balance between qty purchase and qty of revceive product.

Please look to my database and help me.

TestReceive.zip

Posted

Does this help at all?:

http://fmforums.com/forum/topic/84644-making-database-for-inventory-control/

Posted

Hi, Thank you for answer, But I can't find answer.

I need a script for my problem and I want someone look to my script and correct that.

Thank you

Hi, thank for answer,

But I can't find my answer. I need someone look to my script at correct it or send me some suggest.

Thank you very much.

TestReceive.zip

Posted

Well. Here are a few problems with your script:

1. Don't use global variables unless you really need to. I.e., use single $, not double $$.

2. You go to layout "Receive" -- when you go to layout, you're going to land on whatever the last record you viewed was on that layout. It has no relation to the context you are coming from -- which is what? You should comment your scripts.

3. Then you go to related record (GTRR) Purchase Line. OK, but again, you're starting from some random Receive record, so you're going to go to some random purchase line. Specifically, the first purchase line related to the product on that receive record.

4. You test for Get( FoundCount ) = 0 but you didn't turn on error trapping. Back in FileMaker 6, if you did a GTRR and there were none found, you'd end up on the target layout with no records in the found set. That's not the case today. You will simply stay where you are and get an error. So if you did have error trapping on, you'd still be on the Receive layout and you'd create a new record. Is that what you want to happen? You really should comment your scripts.

5. Assuming you did create the new record in the script, what's the point of go to field? There's no pause there (the pause comes later), so you won't have a chance to enter the date.

Anyway...

One idea you might consider is opening a new window to enter the receive data. First set your variables, then commit the record, then open a new window -- and remember in FM12 it can be a modal dialog -- go to the receive layout, find the product ID, if 0 found etc.

One last thing, if you're using 12 advanced, use the script debugger and data viewer! You'll see right away what the problems are.

This topic is 4573 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.