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.

Enter related db data into new record - sometimes?

Featured Replies

Hi,

We have two related databases - one is People.fm5, and the other is Events.fm5. Each record in Events has to refer to one of the people in People.fm5. So we relate the two with a unique ID number, and a portal in People finds all the events for each person.

The problem is, a dozen users will be creating records in the Events db, and they have to enter the correct ID number out of about 200, which is a drag. So I want to allow them to search the People db, and click on a link for the right person that will call up a format file for a new record in the Events db.

How do I get the ID number (which is known in the People db) autoentered into a field in that "new-filled" format file? And other fields too? I don't want to do it by a lookup in the Events db because I also need to allow people to just type those things into a blank new page. I thought I could do it via CDML but I haven't figured out how yet. I guess I don't know exactly how values come and go from those fields in format files. Or is this the place for a token? And how do tokens come and go?

  • Author

Maybe this isn't so hard after all. I got a token working so that it enters the ID number - that was the critical part. In the form that generates the new page I used

Input type="hidden" Name="-token" Value="[FMP-Field: ID]"

and in the new page I used:

Input type="text" Name="ID" Value="[FMP-CurrentToken]"

This passed the ID number to the new page.

Now how do I do this with other data at the same time, such as names? Can I have more than one token at once?

Once you've passed and entered the ID in the proper field just set up the other fields in Events.fp5 to look up proper info from the People.fp5 file

And yes, in FM5 you can have 10 tokens.

  • 2 weeks later...
  • Author

Thanks, Pupiweb and Anatoli.

I set up the lookups for the other fields and they work great for this after all. (Never mind what I was thinking before.)

Anatoli, how do you specify which token is which? I tried "token2" and it didn't recognize it. And doesn't the web browser have to keep track of the token(s)?

Get the CDML reference:

Up to nine tokens can be used by using a slightly different syntax for the token tags.

(Anatoli -- that is in fact 10)

The variable tag -Token can have an optional token specifier of the form -Token.X where X can be the characters 0 through 9.

If no period follows the -Token keyword then token one is implied.

To retrieve the value of a token the FMP-CurrentToken will accept another parameter that is a number, of value 0 through 9.

If there is no number parameter, but there is a period, then token zero would be returned.

and:

Example format file snippet:

<!-- Pass the value of token three onto the next request -->

<INPUT TYPE="HIDDEN" NAME ="-Token.3" VALUE ="[FMP-CurrentToken: 3]">

Tokens can be used on the right side of an FMP-If using the intratag replacement syntax:

[FMP-If: CurrentToken:5.eq.{CurrentToken:6}]

<B>Token 5 equals token 6.</B>

[/FMP-If]

  • 1 month later...
  • Author

Thanks, Anatoli! This will help me.

By the way, I already have a copy of what I thought was the "complete CDML tag reference" which I found at:

http://www.kw.nl/~pike/DocZ/filemaker/CDMLref.htm

But this only mentions the possibility of a single token and doesn't describe Token.X. Is there a more complete CDML tag reference somewhere else?

If there is just single Token, it must be from FM version 4.

From FM5 there is 10 Tokens and Inlines and more. Search forums and the CDML reference will show up.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.