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.

Script to create a record if the right choice is made in value list

Featured Replies

Hello

I have attached my first attempt at a script. The idea is simple. Via a value list in the 'type' field , in the 'project' table, I wish to create a new record in the ddf table, if I choose ddf from the value list. I figure this would be not too difficult ... but I think I was wrong. Can anyone help?

Many thanks in advance

Untitled.fp7.zip

You need to grab the proid into a variable first before you navigate off the project layout

plus you don't want to replace but you want to use Set Field.

Hope that helps

Edited by Guest
changed image

and your If statement only needs to be:

project::type= "ddf"

It is also important to know HOW you plan to select from the value list. Can a user always only select ONE? If you use a checkbox and there may be multiple entries then using = will not work for you.

Can that value be one of multiple values in the field or will it be the only value?

Edited by Guest

  • Author

I got to work. I forgot to put in the 'create new record' line. thank you. Incidentally, this is for a drop down value list solution.

Last question, what does $ do?

$Variable is a local Variable. If you write $$Variable, then it would become Global Variable.

Edit:

From FM help,

Variable:

"In a calculation, a symbol or name that represents a value. Use the SetVariable script step to specify the name, value, and repetition of the variable. Names prefixed by $ are local variables available only within the current script. Prefix the name with $$$ to make the variable available throughout the current file (global). Local and global variables can have the same name but they are treated as different variables"

Hope it helps...

Edited by Guest

  • Author

thank you

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.