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.

ValueList with related values

Featured Replies

Hi

I've been reading here that there is a problem in CDML with valuelist with related values.

I've tried all the examples/suggestions and still didn't get it...

Structure & func':

Web_users.fp5 is the file that I use for web interface with the rest of the DBs.

"username" is the field that I use in the relationship with units.fp5.

Relationship name is : "Units List for active systems"

After a user enters his username,It displays all the units of that user in a portal.

"Sys_id_main" is a field that belongs to units.fp5.

I need to be able to have a drop down menu for that field with all the "sys_id_main"s that belongs to that user, so the user can shift his units between his systems only.

I managed to do it with a value list in FMP and IWP, but I need it in CDML - and I pretty much stuck.

SO basically I need a valuelist with related values for a related field in a portal....

any suggestions?

  • Author

Hi

I changed the code to the values that I need but still didn't get any results

The code is :

  

<select name="Units List for active systems::sys_id_main">

<script>

[FMP-ValueList: Units List for active systems::sys_id_main, List=active_systems]

val =  "[FMP-ValueListItem]".split(":") ;

document.write("<option value="+ val[0] + " [FMP-ValueListChecked]>" + val[1] + "</option>") ;

[/FMP-ValueList]

</script>

</select>

What did I do wrong?

Did you create a Calculated field which concatenates the two fields? Then create a ValueList based on that Calculated field?

Good Luck.

Garry

  • Author

Hi

I'm sorry, but I don't understand which two fields do I have concatenate?

I've reread your original question.

I believe you need to use [FMP-Portal] or [FMP-InlineAction] tags to achieve what you desire.

Check those two tags in the "CDML Reference" database.

All the best.

Garry

  • Author

Hi

The "CDML reference" does no elaborate too much...

I tried to use various examples that I've found in this forum,

but still no results - It displays NOTHING.

Local DB : Web_users.fp5

Field : Units List for active systems::sys_id_main

Valuelist: active_systems (uses a different realationship : Active_systems).

Realationl DB : Reservations.fp5


[FMP-PORTAL: Units List for active systems]

      <FONT SIZE="-1"><TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0>

         <TR>

            <TD>

               <P><FONT SIZE="-1"><TABLE BORDER=0 WIDTH=71>

                  <TR>

                     <TD>

                        <CENTER<select name="Units List for active systems::sys_id_main.[fmp-currentportalrownumber]" 

VALUE="[FMP-Field:Units List for active systems::sys_id_main]">

[FMP-InlineAction: -db=web_users.fp5, -lay=WebMain -view]

[FMP-Option: active_systems]

[/FMP-InlineAction]

</select></CENTER>

                     </TD>

                  </TR>

               </TABLE>

                </FONT></P>

            </TD>

         </TR>

      </TABLE>

       </FONT>

   [/FMP-PORTAL]</P>

I'm not sure the syntax is correct (my first inline) blush.gif

Maybe some could elaborate a bit about this command and it's syntax.

Tnx alot

Try with

<Select name="FieldName">

<option value=""> Select a value

[FMP-InlineAction:-db==web_users.fp5,-lay=WebMain,User={field:user},-max=all,-find]

[FMP-Record]

<option value="[FMP-Field:System Name]">

[FMP-Field:System Name]</option>

[/FMP-Record]

[/FMP-InlineAction]

This will produce a list of all systems related to a user

Add a sort tag to the Inline if you want to sort the list items

  • Author

TNX !!

It's almost working :

<Select name="Units List for active systems::sys_id_main.[fmp-currentportalrownumber]">

<option value=""> Select a value

[FMP-InlineAction:-db=reservations.fp5,-lay=Web,User1_user2=ntal,-max=all,-find]

[FMP-Record]

<option value="[fmp-field:id]">

[fmp-field:id]</option>

[/FMP-Record]

[/FMP-InlineAction]

</select>

I got 2 problem :

1. I want the field to display the current value of "Units List for active systems::sys_id_main" and not "select a value" - I tried to play with it for a while and I got only the first value of the value list presented in ALL rows.

2. When I cange user1_user2=ntal to user1_user2=[fmp-field:username], it does not work.

fmp-field:username is a field in the local DB and it alway with a valid username value (validation)

If these two are fixed...I'm all set

Point 1 isn't very clear to me but it *should* be enough to put it after the

<option ""> tag

Point2: the problem is a syntax error

Instead of user1_user2=[fmp-field:username] use {field:username}

HTH

  • Author

It's working !!!!

Tnx very very very much for your help.

This is the best forum....and YOU are the man grin.gif

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.