dbTalk Databases Forums  

New Record script step and related tables

comp.databases.filemaker comp.databases.filemaker


Discuss New Record script step and related tables in the comp.databases.filemaker forum.



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

Default New Record script step and related tables - 10-22-2005 , 03:12 PM






Hi Group -

Trying to acclimate myself to V.7 and 8 (old dog, new tricks) and I
can't find this one in the help. In a multi-table file, I must move to
another table and create a record there by script. Although there is no
"Go to Table" navigation step, I can move the script's focus to the
related table just by going to a field in that table, but the New Record
script step still stubbornly creates a record in the original table.
I'm sure I'm missing something. Any advice / explanation deeply
appreciated.

Thanks very much in advance -
James


Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: New Record script step and related tables - 10-22-2005 , 03:20 PM






James wrote:
Quote:
Trying to acclimate myself to V.7 and 8 (old dog, new tricks) and I
can't find this one in the help. In a multi-table file, I must move to
another table and create a record there by script. Although there is no
"Go to Table" navigation step, I can move the script's focus to the
related table just by going to a field in that table, but the New Record
script step still stubbornly creates a record in the original table. I'm
sure I'm missing something. Any advice / explanation deeply appreciated.
Each layout is based on a particular table occurrence to give that
layout context. So you can switch tables by switching layouts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
Michael Paine
 
Posts: n/a

Default Re: New Record script step and related tables - 10-22-2005 , 04:49 PM



Here is some script that I use to check whether a related record exists
and ask the user if they wish to create a new record, if one does not
exist. Otherwise the related records are displayed in table view. First
the variable $$MODEL_CD is set from a field on the layout on which the
script button is located (VEHICLE_MODEL). This is used in the Find
action with the VARIANT layout.

Michael Paine

----------
Set Error Capture [ On ]
Set Variable [ $$MODEL_CD; Value:VEHICLE_MODEL::MODEL_ID ]
Enter Browse Mode
Go to Layout [ “VARIANT” (VARIANT) ]
Enter Find Mode [ ]
Set Field [ VARIANT::model_id; $$model_cd ]
Perform Find [ ]
If [ Get(FoundCount)=0 ]
Show Custom Dialog [ Title: "Confirm New BROCHURE Record"; Message: "A
VARIANT record does not exist for this
model. Create new record?[" & $$model_cd & "]"; Buttons: “Yes”, “No” ]
If [ Get(LastMessageChoice)=1 ]
New Record/Request
Show All Records
Set Field [ VARIANT::model_id; $$model_CD ]
Exit Script [ ]
End If
Else
Enter Browse Mode
Go to Layout [ “VARIANT” (VARIANT) ]
View As
[ View as Table ]
Exit Script [ ]
End If

----------
James wrote:

Quote:
Hi Group -

Trying to acclimate myself to V.7 and 8 (old dog, new tricks) and I
can't find this one in the help. In a multi-table file, I must move to
another table and create a record there by script. Although there is no
"Go to Table" navigation step, I can move the script's focus to the
related table just by going to a field in that table, but the New Record
script step still stubbornly creates a record in the original table. I'm
sure I'm missing something. Any advice / explanation deeply appreciated.

Thanks very much in advance -
James


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

Default Re: New Record script step and related tables - 10-22-2005 , 04:59 PM



Howard Schlossberg wrote:
Quote:
James wrote:

Trying to acclimate myself to V.7 and 8 (old dog, new tricks) and I
can't find this one in the help. In a multi-table file, I must move
to another table and create a record there by script. Although there
is no "Go to Table" navigation step, I can move the script's focus to
the related table just by going to a field in that table, but the New
Record script step still stubbornly creates a record in the original
table. I'm sure I'm missing something. Any advice / explanation
deeply appreciated.


Each layout is based on a particular table occurrence to give that
layout context. So you can switch tables by switching layouts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance

Hi Howard -

Perfect. Many thanks again!

James



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.