Skip 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.

a link from the Filemaker database

Featured Replies

In our custom filemaker solution using CDML, I want to create a Filemaker link in the filemaker database and have cdml correctly pass it through a browser.

In the database there is a field called: relatedURL

the cdml is:

a href="[FMP-Field:Web_URL_Related_1]" target="-top">&nbsp;[FMP-FIELD: Web_URL_Related_Desc_1]</a>

This works fine for any url except if I want a FMPro type url.

I want to be able to pass a url that might look something like: http://

xxx.com/FMPro?-db=dbase_.fp5&-format=detail.html&-token=[FMP-currenttoken]&-lay=ForWeb&CatalogNumber=24346&-script=Web_English&-find

The token is the problem right now. The [fmp-currenttoken] does not work.

Is there a way to do this?

The [FMP-CurrentToken] tags are probably being rendered/replaced before the [FMP-Field] tags. Hence the embedded tag is not being rendered/replaced.

You may be able use some Javascript to replace it. Or, you may be able to structure the HTML/URL to append the [FMP-CurrentToken] to the end of the URL.

Good Luck.

Garry

  • Author

Garry,

Correct. This is the problem - now how to solve?

I created a javascript

function gettokenurl(baseurl) {

var newurl = baseurl;

var finalurl = newurl;

var pos=baseurl.IndexOf("FMPro?");

if (pos>=0) {

newurl = baseurl + "&-token=[FMP-currenttoken]";

}

return newurl;

}

And the tried to use it in the href="javascript:gettokenurl('[FMP-Field: relatedURL]')"

But the link does nothing when clicking it.

According to a Javascript site - javascript in the Url cannot look for a returned item.

So it is close - but there must be something missing to append [fmp-currenttoken]

Try this:

<script>

currtok = "[FMP-CurrentToken]";

fmurl = "[FMP-Field:Web_URL_Related_1]".replace(/[FMP-currenttoken]/i, currtok);

document.write("<a href='" + fmurl + "' target='-top'>&nbsp;[FMP-FIELD: Web_URL_Related_Desc_1]</a>");

</script>

Good Luck.

Garry

  • Author

Garry,

Brilliant suggestion but taking your idea, I have simplified it even more.

The secret was if the field contains 'FMPro?' we want to maintain the token and do a FMP query.

So the code looks like.

[FMP-IF: Web_URL_Related_3.cn.FMPro?]<a href="[FMP-Field: Web_URL_Related_3]&-format=detail.html&-lay=ForWeb&-token=[FMP-currenttoken]&-script=Web_English&-find">&nbsp;[FMP-FIELD: Web_URL_Related_Desc_3]</a><br>

[FMP-ELSE]

<a href="[FMP-Field: Web_URL_Related_3]">&nbsp;[FMP-FIELD: Web_URL_Related_Desc_3]</a>

[/FMP-IF]

Of course in a month or so, we change and start upgrading to PHP.

Thanks!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.