Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

go to related record "find"

Featured Replies

I am creating a new recipe in a portal on the persons layout. Only the name of the recipe is created. From here I want to go to the layout where information is added.

I have tried a script attached to button:

Commit records/request

Go to related record (show only related records) also tried it without show only

The script takes me to the correct layout but always to the first record.

Seems to me that I may need to do a find, but have failed to create a find that picks up the recipe name and finds itself in the layout.

The portal is in the layout of the person creating the recipe and is related through the person key.

Once you Commit (I assume you mean Exit Record/Request, since your profile shows version 6), you are no longer in a portal row. So going to the first related record means the first related record for the person.

If commitment is an issue, try setting a global number with Status(CurrentPortalRow), then Exit Record/Request, Go to Field [any one in the portal], Go to Portal Row [based on global number field], then Go to Related Record [show only related, relationship].

  • Author

Queue

sorry. I have reset my profile accordingly to FM 7 and Jaguar.

Is your advice still the same?

Yes, but Exit will be Commit and Status will be Get.

  • Author

I have never done this.

So I tried and failed with this script.

Set field [Get ( PortalRowNumber )]

CommitRecords/Request

Go to Portal Row [select; no dialogue; Recipe::Portal Row Number_g]

Go to Related Record

You don't have a field specified to set with Get(PortalRowNumber). If there is more than one portal on your layout, first Go to Field [relationship::field] for one that is in the portal, and then Go to Portal Row and GTRR [show; relationship].

  • Author

Ok I have added Go to Field

Go to Field [Recipe::Portal Row number_g]

Set field [Get ( PortalRowNumber )]

CommitRecords/Request

Go to Portal Row [select; no dialogue; Recipe::Portal Row Number_g]

Go to Related Record [show only related records...

I end up in the layout but still at the first record.

No, look at the order of the steps in my first post.

You are assumably in a portal row when the button is clicked, correct? So you

Set Field [Recipe::gPortalRowNumber; Get(PortalRowNumber)]

Commit Records/Requests

Go to Field [any related field in the portal] <- gets you back into the portal

Go to Portal Row [select; no dialog; Recipe::gPortalRowNumber] <- gets you into the right row

Go to Related Record [show; relationship]

  • Author

The Portal row Number did not populate the field.

I notice that you do not leave spaces between words in our field names?

Where is the button located? Within each portal row?

It is a good habit not to use spaces. Use underscores _ if necessary. When you put your data online, it will make things much easier.

  • Author

The button is in each portal row.

See attached working sample.

An alternative might be to use a script parameter of Get(PortalRowNumber).

Test.zip

  • Author

Is it important to use a Global field to contain the Portal Row Number?

My efforts still only take me to the first record.

Not necessarily. It just utilizes less space.

Here's a version using a script parameter instead.

Make sure that the Go to Field step specifies a field that is actually in the portal, not just related.

Test2.zip

  • Author

I was experimenting with your original test and took the Serial field out of the portal and your test still worked.

I'll have a look at your new file after supper.

cheers

Hmm, so it does. I would suspect that is not intentional functionality though, and wouldn't rely on it in case it's fixed later on.

If you get to the end of your wits, feel free to stuff your file and attach it here. Maybe we'll see something that isn't obvious.

  • Author

Good Morning

I noticed another difference in our test and my application.

Your relationships in the test are many to many where mine is a one to many relationship.

attaching a snapshot of the table graph

  • Author

Hi

Tried out your suggestions in the secont test file using the script patameter and it worked.

Thank you ever so much for your assistance.

I'm looking forward to the day when I understand why it has worked.

I don't know how to change the TO diagram to show only one-to-many. Can that even be done? Mine defaulted to many-to-many.

  • Author

Strange, mine defaults to one to many. In fact conversations with db architects suggest to me that many to many are somewhat of a strange bread to deal with.

Not necessarily strange, but not the most common. I have no idea what criteria FM uses to determine which type it should be. But that shouldn't have any bearing on how it behaves if there ends up being only one parent record for each child.

Queue, Gary,

I learnt this one recently. The TOG will show a one to many instead of a many to many if the key is defined as an auto-entered serial number, it is set to be unique, or it is a global.

Thanks Ender. That makes sense, too. My examples usually use an auto-entered calculation of Get(RecordID) instead of an auto-entered serial.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.