![]() | |
#11
| |||
| |||
|
|
"Matt Wills" <I'm (AT) Witz (DOT) end> wrote in message news:53a_e.11242$L15.2580 (AT) trndny01 (DOT) .. Scripting between files is a simple matter of using the Perform Script script step, in which you select "External Script", identifying the other file and which script to run. The destination script has to be there, first, though. OK,I tried that but could'nt find how to pass parameters from one script to the other. Passing parameters doesn't happen natively until FM7. The workaround: Create global fields as necessary to receive your parameters using the Set Field script step. With relationships existing between files, you can have a script in one file set a g.Field value in a different file. You can do that in either direction (from or to the active file). I tried that,and of course it works fine,thanks. One question: I designed a script to create tickets from a ticketSheet (these are 2 different files, thus 2 different scripts as you suggested). The ticket script needs to know the ticketSheetID,of course (1 to many relationship). Which of the following is best practice: 1) the master script in ticketSheet puts the ticketSheetID into a global currentTicketSheetID field in ticketSheet before it calls the script in file ticket; then the script in ticket goes get the global of file ticketSheet or 2) the script in ticketSheet puts the ticketSheetID into a global currentTicketSheetID field in ticket before it calls the script in file ticket; then the script in ticket gets the global of file ticket In one word: put the global(s) in master file or in slave file? I can't see any reason to choose one or the other. |
#12
| |||
| |||
|
|
Since your scripts are only transferring data from 1 file to another you could set a global in the Main file from 1 script and read it from the second script, this way you can reuse the globals and don't end up cluttering up your files with globals. Interesting technique, thanks. |
|
The only issue here you should be aware of is that if the found count in the Ticket file is 0 and your trying to read related data from the Main file through the above mentioned relationship, you won't get any results because the relationship is not valid until you have some records. I see... thanks for warning! |
#13
| |||
| |||
|
|
"FP" <a (AT) pottnerconsulting (DOT) ca> wrote in message .... Since your scripts are only transferring data from 1 file to another you could set a global in the Main file from 1 script and read it from the second script, this way you can reuse the globals and don't end up cluttering up your files with globals. Interesting technique, thanks. Any good book on FM programming tips of that sort? The only issue here you should be aware of is that if the found count in the Ticket file is 0 and your trying to read related data from the Main file through the above mentioned relationship, you won't get any results because the relationship is not valid until you have some records. I see... thanks for warning! That's the kind of potential bug that'd be time consuming to find! -- Fjordur |
![]() |
| Thread Tools | |
| Display Modes | |
| |