You can create or update records through relationships, or you can go to a layout based on the correct table, find the record, and update, or if none found create a new record. If needed you can do this in a new window.
Are you looking at the printed docs? IMO, the online documentation is pretty good.
Can you explain why you are trying to do this? A more full detailed explanation wil help with better advice.
I'm sorry, I haven't been clear enough.
My database contains information on members of an investment club. Each member has contributed a certain (mostly different) amount to the 'kitty', sometimes in different installments. Every Quarter the profit / loss of the total investment is distributed across the club members.
The script I'm making now is what I call the quarterly batch run. Based on the input parameters (year and quarter), I run through the member contributions (possibly more contributions per member and a contribution can have been made during the quarter and therefore not fully liable for a profit/loss adjustment). The basic processing is working fine (also thanks to your help) but I want to "save" the sum total of the adjustments in a table which essentially is no more than a record with year, quarter and sum-total fields. The first time I process I'll need to create the record in the table.The existance of the record is also the registration of the fact that the quatrerly profit/loss has been processed. But it''s possible I'll need to run the script more often for the same quarter so I'll need to check if the record already exists.
I'm only getting familiar with Filemaker, but I have extensive experience with Cobol, CICS, etc. (yeah, that generation!!). I am therefore used to retrieving records on key and field values. If the record does not exist, then you 'write' the record with the appropriate field values. I guess I'm just looking for the equivalent statements in Filemaker script language. Maybe my "index sequential" past prohibits me from thinking in a Filemaker way.
Anyway, I hope this is sufficient background. Cheers, Mike
As I said I'm still getting failiar with Filemaker. I have a Cobol/index sequential past and heve taken up programming recently. I understand your solution but I have a question: is it possible to go to a layout and process as you suggest without the layout appearing on the screen? or does a go to a layout automatically put it on the screen.
Also, how exactly do you create a record in a table in the scripting language. Is that the commit statement?
Thanks again, Mike
You can specify negative numbers (or very large numbers) in the window's Top and Left options to make the window draw off-screen.
One way to create a record is the script step New Record/Request. (If you're in Find mode it makes a new find request rather than a new record.)
Another possibility is to create a relationship and select the "allow creation of records" option in the relationship. You can then make a portal on the parent layout. In your script, you can go to the last row of the portal and use Set Field to push data into the related field, which will create the related child record.
There are also fancier techniques that can create the child records without a portal.