Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

valuelists: ID + Description


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

Recommended Posts

  • Newbies
Posted

Hi all,

i'm very new to filemaker & cdml and i have a q:

how to use a valuelist with two values ID and Description, show the description but store the ID? ... it should be sooo simple, but i cant make it work frown.gif

thanks in advance

Posted

I think this is what you want...

Create a separate file ("ValueLists.fp5") with two fields, "ID" and "Description".

In the main file, create a value list that is the contents of the "Description" field in ValueLists.

Create a relationship between the field in the main file and the "Description" field in ValueLists.

Create a calc field in the main file that returns the related "ID" -- or, if the information in the ValueLists file is edited occasionally, make it a text field that auto-enters the related "ID". You don't have to put that field on any layout, but the info will be there.

HTH,

Dan

  • Newbies
Posted

quote:

Originally posted by danjacoby:

I think this is what you want...

....

HTH,

Dan

nopes, what i need is to select a client showing the name but storing the ID

on filemaker works great, but on the web it shows only IDs (not descriptions) by using this code:

<select name="ClienteID">

<OPTION VALUE="">- Seleccionar Cliente -

[FMP-valuelist:ClienteID,list=SeleccionarClientes]

<OPTION VALUE="[FMP-valuelistitem]">[FMPvaluelistitem]

[/FMP-valuelist]

</select>

the valuelist is defined using ClienteID and CliNombre as second field.

i'd like to get access to each field of the valuelist separately

thanks

mlt

Posted

Well, Not real sure on the Web side of things if this will work, but it's what I use for my solutions. You have 2 fields on your layout, One for ID and the Other for description. Your ID field will be the pop-up that uses the ID as its primary value and the Description as a secondary value. Sort by the secondary value(description). Then On the Description Field in your layout make it a button that uses the "goto field" command and point it to the ID field. Check the box that says "select/perform". Then Lay the Description Field on top of the ID field. So in browse mode, when you click the field, it shows a list of descriptions(and IDs), and when you select one, the description shows in the Description field. Because its ontop of the ID, you never see the ID unless your in the popup window.

Also make sure your Description field has lookup to the description in the child file based on the ID field.

Hope this helps

  • Newbies
Posted

ASNL:

thats the idea i had ... but thought there has to be a built-in solution for this kind of things frown.gif

besides the web is my real problem, but thanks just for the response!

mlt

  • Newbies
Posted

The easiest way to use this for the web use is to forget about using the value lists and instead create a calculated field in the table where the desired values are stored. Use the following def for the calculated field:

"<OPTION VALUE="""&ID&""">"&DESCRIPTION&"</OPTION>"

Then create a script that goes through all the records and exports this calculated field to a txt file in your web folder.

In your web page use the [FMP-INCLUDE: textfile.txt] between the SELECT tags.

Then setup some script that exports a new file everytime you add/edit a record to the file that contains the list information. Or... do what I do and run a weekly update.

  • Newbies
Posted

... very clever =)

... but i discovered the [fmp-inlineaction] tag ... it will do the job!

thanks ... (maybe i'm using your idea for other purpouses)

mlt

ps=i still think that these are only patches ... FM *should* do this job !

quote:

Originally posted by pimpin:

The easiest way to use this for the web use is to forget about using the value lists and instead create a calculated field in the table where the desired values are stored. Use the following def for the calculated field:

"<OPTION VALUE="""&ID&""">"&DESCRIPTION&"</OPTION>"

Then create a script that goes through all the records and exports this calculated field to a txt file in your web folder.

In your web page use the [FMP-INCLUDE: textfile.txt] between the SELECT tags.

Then setup some script that exports a new file everytime you add/edit a record to the file that contains the list information. Or... do what I do and run a weekly update.

This topic is 8291 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.