Keeping Globals in synch with fields

Keeping Globals in synch with fields

Post by Trygve Ind » Thu, 07 Jun 2001 07:56:30



I think I found a solution to my problem, but it creates a new (smaller I
hope) problem.

I have a couple fields in one database, whose contents need to be copied to
two globals in another database (which in turn uses these values to
establish a relationship, which sums values in a related database, and
finally passes this sum to the original database via a portal).

I need to keep the globals in the distant database in synch with the current
record's settings in the main database.

I have a script that sets these values. Is there a way to force this script
to run when the current record changes to a different record or when one of
the fields is changed?

I can't "pull" the data into the Globals because there is no 1:1
relationship, so the data must be "pushed" into the global.

Thanks,

Trygve

 
 
 

Keeping Globals in synch with fields

Post by Jame » Thu, 07 Jun 2001 15:00:16


Hi again Trygve -

Running scripts in response to events is difficult in FMPro.  There are plug-ins
that can do it, but they add overhead and I wouldn't recommend trying to run a
script every time any record is modified.  With that said, are you aware that
you can use a universal relationship (between indexed, non-global fields in each
database which ALWAYS have the same value in every record) to pull data from
globals to any database with the Set Field step?  It sounds as if this method,
sometimes detailed in the group, might be appropriate to what you are trying to
do.  I admit, though, that even after all these posts your solution's design
remains something of a mystery to me.  I hope this hint helps you to make
progress.

Best of Luck -
James


> I think I found a solution to my problem, but it creates a new (smaller I
> hope) problem.

> I have a couple fields in one database, whose contents need to be copied to
> two globals in another database (which in turn uses these values to
> establish a relationship, which sums values in a related database, and
> finally passes this sum to the original database via a portal).

> I need to keep the globals in the distant database in synch with the current
> record's settings in the main database.

> I have a script that sets these values. Is there a way to force this script
> to run when the current record changes to a different record or when one of
> the fields is changed?

> I can't "pull" the data into the Globals because there is no 1:1
> relationship, so the data must be "pushed" into the global.

> Thanks,

> Trygve

--
Don't forget to remove the obvious spam block when replying.
I advocate making an address book entry and using it!  Thanks!

 
 
 

Keeping Globals in synch with fields

Post by Leroy Ervin, Jr » Thu, 07 Jun 2001 10:38:55


Create a relationship between the databases in question by creating a field
(ex: "All Records" a numeric field) in both database and set auto enter to
1.
Whenever a new record is inserted into the database, each record will have
"All Records" equal to 1.  This will provide a relationship between the
files and you will have access to the global value via a script.

Leroy


Quote:> I think I found a solution to my problem, but it creates a new (smaller I
> hope) problem.

> I have a couple fields in one database, whose contents need to be copied
to
> two globals in another database (which in turn uses these values to
> establish a relationship, which sums values in a related database, and
> finally passes this sum to the original database via a portal).

> I need to keep the globals in the distant database in synch with the
current
> record's settings in the main database.

> I have a script that sets these values. Is there a way to force this
script
> to run when the current record changes to a different record or when one
of
> the fields is changed?

> I can't "pull" the data into the Globals because there is no 1:1
> relationship, so the data must be "pushed" into the global.

> Thanks,

> Trygve

 
 
 

Keeping Globals in synch with fields

Post by Trygve Ind » Thu, 07 Jun 2001 23:54:10


Thanks for the help - it is coming together.

In my Job database I have two globals (Week and Employee). These need to
reflect the data in the Employee database...

EmployeeName (text field) Jobs::Employee needs to be the current record
EmployeeName from the Employee database.

Week in a global in both databases which just needs to be the same and is
easy to copy.

How can I pull the EmployeeName from the current Record into Jobs wi no
common relation?

I have thought about making EmployeeName in Employees a global which would
work, but... Then I'd have to make the database only 1 record and move the
real list of Employee names to another database.

Sorry if this is confusing - my system uses 15 databases and was built over
5 years. It works well in our company, but we (that is, I) am expanding it.

Thanks,

Trygve

 
 
 

1. keeping 2 databases in synch

If there are 2 servers running at different locations and both servers are
running
the same database, and at both locations, there are users running an app
that
basically adds and edits records on either server, does replication or the
transaction
services (when set up properly) keep both databases identicle?

I'm asking because alot of the tables have identity fields (autonumbers) for
their id field.
If someone creates a record in a table on one database, sql server will
generate the next number
available.  If someone does the same on the other server, obviously, they
will get the same
number in the same table.

What happens then, when the synch-up takes place?  How do theses identity
fields co-exist,
with the same number?

Mike

2. ADO and textfile

3. Newbie...How do I keep multiple databases in synch

4. COMPUTER LIQUIDATION "OUT OF BUSINESS"

5. ADO - Keeping Tables in Synch

6. yukon beta - ohohoh

7. How can you keep databases in synch?

8. Is there a limit on the varchar field type?

9. Passing DTS Parent Globals to Child Globals

10. Set field and globals

11. Combo Box array and Text field array synching

12. Import delimited data -- How do I keep fields with numeric character from becomming number fields

13. Fields referenced numerically but keeping the name column.