Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hmmm. Set Field Script doesn't work 1

Status
Not open for further replies.

Kaleidoscope

Technical User
Oct 19, 2005
1
US
The Set Field script step works everywhere but the place I want it to.

Here's the situation:

Filemaker Pro 7 - two tables in database 1) Products Table; 2) Proposal Table


Tables are related via field Product_ID.

Products::product_ID = Proposal::product_ID
One to Many

Proposal Table will have many Lookup fields, with Product_ID as the match field.

Product Table is a parts catalog.
Proposal Table is a quotation generator.

User will browse Product Table list for the right part and click a button/script that will set Proposal::product_ID to the value of Product::product_ID. This will trigger lookups that will fill in the other Proposal fields in the record from the starting record in Products.


Approach:

Set Field [ Proposal Table::product_ID; Product Table::product_ID ]


Problem:

Set Field field doesn't seem to work in the following script, called from Products Table:

Go to Layout [ "Proposal List New" (Proposal Table) ]
Enter Browse Mode
New Record/Request
Set Field [ Proposal Table::product_ID; Product Table::product_ID ]
Commit Records/Requests

Debugging shows that the scripts all execute but Proposal Table::product_ID is left blank.

Discussion:

All fields are number fields.

This works fine:
A) Set Field [ Product Table::Test; Product Table::product_ID ]

This does NOT:
B) Set Field [ Proposal Table::product_ID; Product Table::product_ID ]

But if I follow B with C:
C) Set Field [ Proposal Table::g_test; Get ( LastError ) ]

Then, C) works by putting a value in Proposal Table::g_test. (The value is 0, indicating no error.)

Question:

Why does B) not work?

Thank you in advance for any advice.
 
Have you tried setting a global field in the Proposal table to the Product::product ID? Like below:

Set Field [Proposal Table::_GL VarText; Product ID]
Go to Layout [ "Proposal List New" (Proposal Table) ]
Enter Browse Mode
New Record/Request
Set Field [ Proposal Table::product_ID; _GL VarText ]
Commit Records/Requests

It would seem to me that you can not set field Proposal::product_ID on the new record because it doesn't relate to the record from the Products table. You're trying to go to the other file and set a field but the relationship is based on a field that doesn't have a value.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top