Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8336 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

The inherent problem is that, as you perform finds, sorts, etc., the "previous record" can change.

Certainly you can pull info from one record and insert it into the next. One simplified example:

code:


GoToField(FieldWithInfo)

Copy

GoToRecord (Next)

GoToField(FieldWaitingForInfo)

Paste

This may be oversimplified, and there are other ways to script it, but it works.

Posted

I have a list of records in a portal and based on record type I want to get a value from the record above and the record below.

I am trying to avoid a script because there will be thousands of records and a script would be to tedious.

There is not a concern about the records above and below changing because it is in a portal and entry order is the sort.

Posted

-----------------------------------------------

"There is not a concern about the records above and below changing because it is in a portal and entry order is the sort."

-----------------------------------------------

WARNING! This may not be true! The state of a portal, i.e. shown records, sort order etc. does not necessarily represent the state of the database.

This means that go to record commands etc. will work on the sort, find order of the actual found count, and not the portal. Copying info from previous records can be a dangerous thing. Especially as for FMP the previous record is not necessarily the record before the record you are currently on. What I mean with this is the following:

If you have 5 records listed, and you are currently on record 3, and take info from the previous record, FMP does not immediately presume you mean record number 2. FMP will grab info from the last visited record, so if you have clicked into record 3 from record 5, it will copy info from record 5.

This is explained pretty well in the FMP help files.

Rigsby

Posted

Rivet,

Not sure I understand you, but, say you are testing data in row 3 of a portal and based on the result, you want to grab info from the records relating to rows 2 and 4 in the portal, then you can do this.

To illustrate, you need 3 fields: gportal_row, (a number field) and 2 texts fields - info_above and info_below. Then one script set to a transparent button on the first portal row so that it replicates on all portal rows.

Set Field (info_above,"")

Set Field (info_below,"")

Set Field (gportal_row, Status(CurrentPortalRow) -1)

Go to Portal Row ( gportal_row, By Field Value)

Set Field (info_above, rel::data_you_want)

Set Field (gportal_row, gportal_row +2)

Go to Portal Row ( gportal_row, By Field Value)

Set Field (info_below, rel::data_you_want)

Set Field (gportal_row,"")

Go to Field()

Clicking in any portal row will generate a result in info_above and info_below. You'd probably want to modify this to trap for odd results if you're clicking in the first or last portal row. And you'll need to script the test for the record type; wasn't sure whether you want it performed on the related record or the record you are currently browsing.

HTH

Posted

quote:

Originally posted by rivet:

I have a list of records in a portal and based on record type I want to get a value from the record above and the record below.

I am trying to avoid a script because there will be thousands of records and a script would be to tedious.

There is not a concern about the records above and below changing because it is in a portal and entry order is the sort.

You'll need to implement an "linked list" structure and than you can interrogate records via relationships "myParent" and "myChild"

Dj

This topic is 8336 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.