![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hello all, I've got one file named contacts.fp5, which contains people info and another named invoices.fp5, containg, well... invoices. The invoices file has a field "invoice_custid" (unique), which I successfully related to field "contact_id" (unique) in my contacts file. When I enter the invoice_custid, it automatically fetches the related data (name, address, etc) from the contacts file I want to be able to add a button to my contacts file which instantly creates a new record in the invoices file related to the current contact record. I guess I need some kind of button script to do this, but I'm new to FMP, coming from MySQL (which has a completely different interface). All help is much appreciated. .soma |
#2
| |||
| |||
|
|
You can do it with a Portal in the Contacts file. First, the relationship from the Contacts file as Master to the related Invoice file has to be defined to allow creation of related records. See File Define relationships in the Contacnts file to do this. Then put a portal from the Invoices file into a layout of the Contacts file. Put suitable fields from the Invoices file into the portal, such as date, amount, etc. Now when you go to the portal, click in the first empty row, and enter data. That will create a new related Invoice record, related to the contact. Done. No need for a script. Bill |
#3
| |||
| |||
|
|
You can do it with a Portal in the Contacts file. First, the relationship from the Contacts file as Master to the related Invoice file has to be defined to allow creation of related records. See File Define relationships in the Contacnts file to do this. Then put a portal from the Invoices file into a layout of the Contacts file. Put suitable fields from the Invoices file into the portal, such as date, amount, etc. Now when you go to the portal, click in the first empty row, and enter data. That will create a new related Invoice record, related to the contact. Done. No need for a script. Bill Thanks for the help Bill, very useful. But I think I wasn't specific enough. I need users to be able to: * click somewhere in the contacts file (perhaps a button that says: <<make new invoice for customer>>) * the invoice file should automatically open, showing a new record tied to the contacts record * the user then can fill out this invoice and print it immediately in the layout specified in the invoice file I know your way will work, but then the user would need to open the invoice file, search for the record and print it. Any hints? |
#4
| |||
| |||
|
|
No offense to Matt but there is a much better way to handle your needs. |
#5
| |||
| |||
|
|
Good point! I thought he had a relation set up already so that he could display the customer info on the invoice? |
#6
| |||
| |||
|
|
Good point! I thought he had a relation set up already so that he could display the customer info on the invoice? I have. Anyway, thanks for both you guys efforts, with your advise I'm sure I can handle it from here. As to my "abilities": this is my first fmPro db, and although I know my fair share of SQL and relational database theory, it doesn't seem to do much good on this one. Why did they have to go and call tables "files" and rows "records"? Why do you have to build "scripts" instead of regular queries and table joins? Is it supposed to be "user friendly"? Well to me it sure isn't. |
|
I don't think I'll be dabbling with this freak of an rdbms again... |
|
thanks, again, .soma |
#7
| |||
| |||
|
|
I don't think I'll be dabbling with this freak of an rdbms again... thanks, again, |
#8
| |||
| |||
|
|
You can do it with a Portal in the Contacts file. First, the relationship from the Contacts file as Master to the related Invoice file has to be defined to allow creation of related records. See File Define relationships in the Contacnts file to do this. Then put a portal from the Invoices file into a layout of the Contacts file. Put suitable fields from the Invoices file into the portal, such as date, amount, etc. Now when you go to the portal, click in the first empty row, and enter data. That will create a new related Invoice record, related to the contact. Done. No need for a script. Bill Thanks for the help Bill, very useful. But I think I wasn't specific enough. I need users to be able to: * click somewhere in the contacts file (perhaps a button that says: <<make new invoice for customer>>) * the invoice file should automatically open, showing a new record tied to the contacts record * the user then can fill out this invoice and print it immediately in the layout specified in the invoice file I know your way will work, but then the user would need to open the invoice file, search for the record and print it. Any hints? |
![]() |
| Thread Tools | |
| Display Modes | |
| |