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.

select a default in list built with InlineActition

Featured Replies

Thanks to inputs from this forum I've been able to successful build a value list from a another database using FMP-InlineAction.

Now I'd like to be able to select a default value in the value list based on the current value for the field in the record being edited. So my question is, in the code below I use the literal value "2" for my FMP-If comparision, but what I really need to do is compare to the value in the field of the current record in my database being edited. I just don't know the syntax to refer to a field in this database once inside a InLineAction tag.

Hope this is clear and any suggestions are of course appreciated.

<SELECT NAME='genus_id' SIZE=1 >

<OPTION VALUE=""> - No Selection -

[FMP-InlineAction: -db=genusDB.fp5, -lay=mylayout, -findall]

[FMP-Record]

<option value="[FMP-Field:genus_id]"

[FMP-If: Field:genus_id .eq. 2]

SELECTED

[FMP-Else]

[/FMP-IF]

>[FMP-Field:description]

[/FMP-Record]

[/FMP-InlineAction]

</SELECT>

Here is a metod using some Javascript:

<script>var genusid = [FMP-Field: genus_id];</script>

<SELECT NAME='genus_id' SIZE=1 >

<OPTION VALUE=""> - No Selection - </option>

[FMP-InlineAction: -db=genusDB.fp5, -lay=mylayout, -findall]

[FMP-Record]

<script>

if (genusid == [FMP-Field:genus_id]) {

document.write('<option value="[FMP-Field:genus_id]" selected>[FMP-Field:description]</option>');}

else {

document.write('<option value="[FMP-Field:genus_id]">[FMP-Field:description]</option>');}

</script>

[/FMP-Record]

[/FMP-InlineAction]

</SELECT>


Hope this helps.

Garry

RE: Thanks to inputs from this forum I've been able to successful build a value list from a another database using FMP-InlineAction.

Why not to do it directly in FM database? It will be faster because the WC doesn't have to process another request.

  • Author

Garry,

Your example didn't just help, it worked !

It's also nice to now have a java script example I can adapt to other uses. Many thanks as always.

Hunter

  • Author

Anatoli,

Also, thanks for your suggestion. The reason I used FMP-InlineAction to create the value list was because the database with the values for the list was related through an id field and I wanted to show the description in my dropdown. I was unable to make this work with a value list defined in Filemaker.

Hunter

The related value list is standard in FM.

Description is done in HTML code.

InLines are great and with incredible power, but their use is really just if you must process something in other database on the same page as the main db.

  • Author

Some aspects of this discussion are beyond my present Filemaker skill level. But in general, I'm interested in learning new ways to solve problems especially if it can be done simpler.

But, in this case I refer you to the earlier thread in the CDML forum:

"Value lists: store ID, but display description ? "

Where what I needed was to "process something in other database on the same page as the main db."

If the InLineAction solution I used was too heavy you are of course welcome to show me a better way to solve this.

Hunter

Maybe I do not understand your problem. I usually do found easily solution of any problem, which crossed my way. The hardest part is for me understand what is the problem, when I know nothing about other people solution logic.

It is the same like translation from English: driver can be anything from software, through Hi Frequency Speaker, car or railway engine driver. In our language we have usually separate words for each different driver.

Start with FileMaker -- you can have the Value list in other file linked to current file, can you?

The problem is that the information from a second field, in the value list, is not accessable from the value list. For example:

<select name="myfield">

[FMP-ValueList: item_ids]

<option value="[FMP-ValueListItem]">[FMP-Field: item_description]</option>

[/FMP-ValueList]</select>


Hence, an [FMP-InlineAction] may be the best method.

Hope this makes sense. All the best.

Garry

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.