Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Fm13 and Fm GO - issue scripting new record selecting from related table


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

Recommended Posts

  • Newbies
Posted

Hello Guys,
i’m a novice in the filemaker world and as every new challenge, i don’t miss to get stuck in some problem, called “script”.

Let me explain: 

I have got 5 tables called :

1. Table “Company”
2. Table “Customers”
3. Table “Terapy”
4. Table “Trap”
5. Table “Report”


They are related as follow:

1. Table “Company”:: Id company…… X ….. “Table “Customers”:: id customer

2. Table “Customers”:: Id customers…… = ….. “Table “Terapy”:: id customer
Table “Terapy”:: Id terapy………….… =. ….. “Table “Terapy”:: id terapy

3. Table “Terapy”:: Id trap…… = ….. “Table “trap”:: id trap

4. Table “Terapy”:: Id report…… = ….. “Table “Report”:: id raport


I have developed already the Desktop interface, with tabs, buttons and checkbox, and everything seams to going good, i can add data into the table “customers” and i am adding data in the related tables using Portals, so like this the database is populating and working in the desktop side. 

I did the same with the preparation of the “IPAD” interface, i ve developed one main layout called "“Customer | ipad ”, where i can add customer data (as name-surname etc..)and add two buttons, which links to the “report layout | ipad ” and “trap layout | ipad”

……… The troubles start here when i pushed these buttons……

What i would like to do when i push the buttons is: 

1. Check if any record exist already in the “report” or “trap” table a record, if is not then i would like to create it, relating the Customer id, trap id and terapy id.

2. When i am in the ipad layout “trap layout | ipad” and ”report layout | ipad” , with the help of a button called “add new record ” , add a new record relating the Customer name and surname or customer id.


Actually the script to go from the “Customer layout | ipad” to the “Trap layout | ipad” look like this: 

Script name : “go to trap | ipad”

Set Variable [$$ Current_customer; Value: Customers::idcustomers]
Set Field [Trap:: Data;””]
Go to related Record [show only related records; from table: “Trap”; using layout “trap layout | ipad”(Trap)]
if[Get(LastError)=0]
Sort Records [Restore;No dialog]
Halt Script
End If
Show Custom Dialog [“No Trap’s records, add new?”]
if[Get(LastMessageChoice)=1]
Halt Script
End if 
Go to layout [“trap layout | Ipad”(Trap)]
New Record/Request

——————————————————————————————————————

Script to add a new record in the ”trap layout | ipad” using filemaker go: 

Script name: "Trap new record | ipad"

Go to Related Record [From table: “trap”; Using layout: “trap layout | ipad” (Trap)]
Go to Field [Terapy::id terapy]
New Record/Request
Insert Current Data [select; Trap::data]


What do you think can you please help me in solve my lack of knowledge? I really appreciate any thoughts 
Thank you guys

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