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.

How to insert a variable into a field

Featured Replies

Hi. I need help with a script line that will insert a variable into a field.

Here's the premise: I have two related tables: contact info and project info. From the contact info layout, I had a script that copied the clientNumber and then created a new record in the project table and pasted the clientNumber into the new record thus automatically linking the project to the client. The copy/paste method fails of course because of clipboard issues.

Now I'm trying use a variable to handle this task. What I want is for the script to set variable X to the clientNumber then when the new record is created, insert the value associated with the variable. I've been experimenting with the Set Field and Insert functions but have had not luck.

Is this the right approach, is there a better way to handle this type of thing?

Thanks in advance for your help

You're almost there. Check out the New Invoice button on the Quote form in the attached demo. It shows how to capture a key and populate the foreign key, using a $var.

QuoteInvoice.fp7.zip

Try something like:

Set Variable [ $clientNo ; Contacts::ClientNumber ]

Go to Layout [ Projects ]

New Record

Set Field [ Projects::ClientNumber ; $clientNo ]

...

I presume you'd want to set more fields at this point, rather then creating an empty related project.

Another option is to pass the ClientNumber as script parameter, then:

Go to Layout [ Projects ]

New Record

Set Field [ Projects::ClientNumber ; Get (ScriptParameter) ]

...

  • Author

AWESOME. It's working now. Thanks to you both.

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.