This sounds like a question that should be asked in Using Filemaker rather than Using Filemaker Server--though the new forum software makes it all too easy to lose track of which forum you're in at any given moment...
Please post your script. A fairly easy way to do this is to print your script to a PDF and then use Acrobat Reader's text tool to copy and paste the script text to the forum. If you have filemaker advanced, you can copy the script from a database design report.
Hi, yeah your right didnt realize i was in the server forum still!
Sample script as below, i have tried this again just now and it has seemed to work ok. Although yesterday i couldnt update the new service record as it said it was already being updated. Would me adding the various files in the 'External data source' menu make any difference?
- Set Variable [ $custid; Value:clients::cust id ]
- Set Variable [ $surname; Value:clients::surname ]
- Set Variable [ $address; Value:clients::address ]
- Set Variable [ $street; Value:clients::street ]
- Set Variable [ $town; Value:clients::town ]
- Set Variable [ $country; Value:clients::county ]
- Set Variable [ $postcode; Value:clients::post code ]
- Set Variable [ $telno; Value:clients::tel no ]
- Set Variable [ $mobile; Value:clients::mobile no ]
- Open File [ “service” ]
- Set Field [ service::cust id; $custid ]
- Set Field [ service::Customer Surname; $surname ]
- Set Field [ service::Address; $address ]
- Set Field [ service::Road_street name; $street ]
- Set Field [ service::Town; $town ]
- Set Field [ service::County; $county ]
- Commit Records/Requests
- Go to Related Record [ From table: “service”; External; Using layout: <Current Layout> ]
I started with this option as we might want to fill out a service record by manually entering this information instead of starting from the client file. Thought i could then also add a button(Script) that does the opposite of the above and creates a new client record from the one just created manually in the service file. ?
Many thanks for all the help
Now thinking about this set up again.....
am i better to have the 'client' and the 'service' files defined as tables in the same file rather than 2 seperate files ????
As i have with the 'sales' and 'stock' records.
Comments anyone ?
Filemaker can treat the tables of external files just as though they are all files in the same file. As new user, it's probably easier to have them all in one file, you can use Import Records with the new table option to pull a table and it's data into a different file.
The external file, is the issue here. As currently written, if you keep the separate files, you'd need to split your script into two parts. Part one runs in the first file and then uses Perform script to call the script in the second file, passing the data in a parameter list to the second script.
However, there's a more basic issue here. You should not be copying this data at all. Instead you should only enter this data in the client table and then link it via a relationship in Manage | Database | Relationships to the service table by client ID. With the relationship established, you can simply place the fields from Clients on your service layout and the data will appear when you select a client's id number. New clients should be recorded in the client table before you start a project record for them.
This is just a general outline, you'll have to implement a number of details to make it work. You may need to invest in a training tutorial or a book on filemaker. You are also welcome to keep asking questions here at the forum.
Many thanks yet again,
i have set up as you suggest and let the details in service 'source' from the client file and not store details twice. I did this originally but for some reason didnt pursue this option. I think i came across a problem at the time.
The other set back i have with the seperate file set up as opposed to tables in the same file is that i cant always find and switch lto different layouts in different tables as they arent always listed as available. Think this again is down to me not setting up correctly the linked files/tables.
Have dissected one of the sample files and can see how to perform the script call from the script in the original file, this would works ok aswell,
Have a book on the way so should start to drop into place soon
Many thanks for your input once again
The layout drop down in the status area will only list layouts in the current file. To get to specific layouts in another file, you'd need to write a script in that other file that selects the correct script and then call that script from the first file...
Which illustrates another reason for putting all your tables in a single file...