dbTalk Databases Forums  

saved sets

comp.databases.filemaker comp.databases.filemaker


Discuss saved sets in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
thdyoung@googlemail.com
 
Posts: n/a

Default saved sets - 06-19-2007 , 12:43 PM






I need help scripting the following

take a found set in fileA w records w unique ids

- loop through found set grabbing unique ids, and putting them into a
global field called G_Aid

- for each record in foundset, whizz over to other file called fileB,
and layout 'join_table' which has two fields- Aid, Savid

- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid

- return to fileA and move on to next record in found set and start
process over

- end loop when reach end of found set in fileA

for some reason I can't get fileB to show up in scriptmaker when
scripting from fileA, though fields in fileA and fileB are related and
I've made a file reference to fileB in fileA

i'm not a full time FMPro by any means: any light a.o can shine on the
problem would be good

Marmot


Reply With Quote
  #2  
Old   
Greg Dember
 
Posts: n/a

Default Re: saved sets - 06-19-2007 , 01:48 PM






In article <1182274993.803075.105560 (AT) w5g2000hsg (DOT) googlegroups.com>,
thdyoung (AT) googlemail (DOT) com wrote:

Quote:
I need help scripting the following

take a found set in fileA w records w unique ids

- loop through found set grabbing unique ids, and putting them into a
global field called G_Aid

- for each record in foundset, whizz over to other file called fileB,
and layout 'join_table' which has two fields- Aid, Savid

- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid

- return to fileA and move on to next record in found set and start
process over

- end loop when reach end of found set in fileA

for some reason I can't get fileB to show up in scriptmaker when
scripting from fileA, though fields in fileA and fileB are related and
I've made a file reference to fileB in fileA

i'm not a full time FMPro by any means: any light a.o can shine on the
problem would be good

Marmot
It sounds like you need to create a script in fileB that performs the
actions that affect that file's records. From your outline, it would be
these two steps:
Quote:
- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid


From the script in fileA, one of your steps will be "Perform Script
(External)", and that is how you will call the script in fileB. Each
time, after the fileB script is executed, control will return to the
script in fileA and it will continue with the loop.

Greg


Reply With Quote
  #3  
Old   
thdyoung@googlemail.com
 
Posts: n/a

Default Re: saved sets - 06-19-2007 , 02:32 PM



On Jun 19, 7:48 pm, Greg Dember <g... (AT) artocratic (DOT) com> wrote:
Quote:
In article <1182274993.803075.105... (AT) w5g2000hsg (DOT) googlegroups.com>,



thdyo... (AT) googlemail (DOT) com wrote:
I need help scripting the following

take a found set in fileA w records w unique ids

- loop through found set grabbing unique ids, and putting them into a
global field called G_Aid

- for each record in foundset, whizz over to other file called fileB,
and layout 'join_table' which has two fields- Aid, Savid

- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid

- return to fileA and move on to next record in found set and start
process over

- end loop when reach end of found set in fileA

for some reason I can't get fileB to show up in scriptmaker when
scripting from fileA, though fields in fileA and fileB are related and
I've made a file reference to fileB in fileA

i'm not a full time FMPro by any means: any light a.o can shine on the
problem would be good

Marmot

It sounds like you need to create a script in fileB that performs the
actions that affect that file's records. From your outline, it would be
these two steps:

- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid

From the script in fileA, one of your steps will be "Perform Script
(External)", and that is how you will call the script in fileB. Each
time, after the fileB script is executed, control will return to the
script in fileA and it will continue with the loop.

Greg
v helpful: thank u

marmot



Reply With Quote
  #4  
Old   
Hans Rijnbout
 
Posts: n/a

Default Re: saved sets - 06-19-2007 , 04:55 PM



<thdyoung (AT) googlemail (DOT) com> wrote:
Quote:
take a found set in fileA w records w unique ids

- loop through found set grabbing unique ids, and putting them into a
global field called G_Aid

- for each record in foundset, whizz over to other file called fileB,
and layout 'join_table' which has two fields- Aid, Savid

- create new record in 'join_table'

- dump contents of G_Aid in join_table::Aid

- return to fileA and move on to next record in found set and start
process over

- end loop when reach end of found set in fileA

for some reason I can't get fileB to show up in scriptmaker when
scripting from fileA, though fields in fileA and fileB are related and
I've made a file reference to fileB in fileA
Marmot,
If I understand you correctly, all you have to do is define a
relationship between fileA::GAid and fileB:: Aid.
Then while looping through your records in fileA you do:
Set Field[Relationship::Aid, GAid]
This creates the new related record (as the ID's are unique) and
populates the Aid field at the same time. You need never to leave fileA
for this.
I wonder if you even need the global GAid, but maybe you need it for
some other purpose. Otherwise you could relate directly from the ID
field in fileA to Aid in fileB.
--
Hans Rijnbout
Utrecht, Netherlands


Reply With Quote
  #5  
Old   
thdyoung@googlemail.com
 
Posts: n/a

Default Re: saved sets - 06-19-2007 , 05:46 PM



problems now w loop

the script loops thru and the global field (G_Aid) duly takes the
value of each records Aid

the new record/set field script in other file is called from Script_A
but I'm getting garbage - a list showing an Aid which isn't even in
the found set !

obviously, there should be a nice list of Aid's matching the list of
Aid's in fileA found set

the number of new records created in fileB matches the no. of records
in fileA found set: good

the rest is just puzzling me

time to sleep

Marmot



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.