dbTalk Databases Forums  

Test for record and go to it or create new one

comp.databases.filemaker comp.databases.filemaker


Discuss Test for record and go to it or create new one in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TM
 
Posts: n/a

Default Test for record and go to it or create new one - 11-19-2006 , 06:17 PM






FMP 8.5 Windows XP

I have two tables Jobs and Reports. Each job requires a report.. From the
Job I need to test if the report has been created and if so go to it if not
Create a New Report for the Job...Can someone please tell me the script to
achieve this. I can't seem to get this right.

Thanks! :0)
T



Reply With Quote
  #2  
Old   
Ursus
 
Posts: n/a

Default Re: Test for record and go to it or create new one - 11-19-2006 , 06:30 PM






Toni,

Your info is not quite enough. I assume your tables are related. How did you
set this up? And can you tell us what you already have tried, so we can see
what it might be that you have missed.

Ursus


"TM" <toni (AT) dataspecifics (DOT) com.au> schreef in bericht
news:4560f407$0$14299$afc38c87 (AT) news (DOT) optusnet.com.au...
Quote:
FMP 8.5 Windows XP

I have two tables Jobs and Reports. Each job requires a report.. From
the Job I need to test if the report has been created and if so go to it
if not Create a New Report for the Job...Can someone please tell me the
script to achieve this. I can't seem to get this right.

Thanks! :0)
T




Reply With Quote
  #3  
Old   
TM
 
Posts: n/a

Default Re: Test for record and go to it or create new one - 11-19-2006 , 06:36 PM



The tables are related and they use the JobNo to relate.
What I have tried and do not have right is:

Copy Jobs:Job No
Enter Find Mode
Paste in Report:JobNo
Perform Find

Aside from this FIND not working in my script I once it find/dont find the
record I want it to go to Layout "Report Reveiw" if no record found I want
it to Perform script "New Report"

thanks so much for your help

"Ursus" <ursus.kirk (AT) wanadoo (DOT) nl> wrote

Quote:
Toni,

Your info is not quite enough. I assume your tables are related. How did
you set this up? And can you tell us what you already have tried, so we
can see what it might be that you have missed.

Ursus


"TM" <toni (AT) dataspecifics (DOT) com.au> schreef in bericht
news:4560f407$0$14299$afc38c87 (AT) news (DOT) optusnet.com.au...
FMP 8.5 Windows XP

I have two tables Jobs and Reports. Each job requires a report.. From
the Job I need to test if the report has been created and if so go to it
if not Create a New Report for the Job...Can someone please tell me the
script to achieve this. I can't seem to get this right.

Thanks! :0)
T






Reply With Quote
  #4  
Old   
Ursus
 
Posts: n/a

Default Re: Test for record and go to it or create new one - 11-20-2006 , 07:08 AM



Right.

For seeing how many related records you allready have you use the function
count.
within jobs create a calc, result as number [ Count ( Report::JobNo ). Wich
returns EMPTy when no reocrds exist, or the amount of recourds that exist if
more then 0.

So now you can create this field, or a similar calculation in a script to
test if you have none ore any.

To find all currently related records you use the scriptstep goto related
record. Selecting the correct layout, relation and activating the option
show only related records. Without further ado you'll find all related
records.

And if there a no currently related records you''ll create a scriptstep that
goes to the proper table and creates the record you need.

Further I would like to add that using copy/paste within a script is not
such a good idea. (what if you need multiple keys to search or enter??)
Please look into the use of global fields, these form a reliable way for
storing and retrieving onetime (or temp, or preferences) data

Ursus


"TM" <toni (AT) dataspecifics (DOT) com.au> schreef in bericht
news:4560f89c$0$29329$afc38c87 (AT) news (DOT) optusnet.com.au...
Quote:
The tables are related and they use the JobNo to relate.
What I have tried and do not have right is:

Copy Jobs:Job No
Enter Find Mode
Paste in Report:JobNo
Perform Find

Aside from this FIND not working in my script I once it find/dont find the
record I want it to go to Layout "Report Reveiw" if no record found I
want it to Perform script "New Report"

thanks so much for your help

"Ursus" <ursus.kirk (AT) wanadoo (DOT) nl> wrote in message
news:4560f71c$0$96518$dbd4b001 (AT) news (DOT) wanadoo.nl...
Toni,

Your info is not quite enough. I assume your tables are related. How did
you set this up? And can you tell us what you already have tried, so we
can see what it might be that you have missed.

Ursus


"TM" <toni (AT) dataspecifics (DOT) com.au> schreef in bericht
news:4560f407$0$14299$afc38c87 (AT) news (DOT) optusnet.com.au...
FMP 8.5 Windows XP

I have two tables Jobs and Reports. Each job requires a report.. From
the Job I need to test if the report has been created and if so go to it
if not Create a New Report for the Job...Can someone please tell me the
script to achieve this. I can't seem to get this right.

Thanks! :0)
T








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.