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.

Creating a new record in another database

Featured Replies

Newbie Question:

I want to create a new record in a related database and populate its fields with some of the values from the current record displayed. How do I do this, if it's even possible?

The ScriptMaker seems very basic.

Thanks

Graham

Edited by Guest

You surely can do it plus other wonderful things using FM scriptmaker. The power of scripmaker rests on the user.

To cut a long story short...From your current screen, create a button with the following:

Go to layout [yourrelateddatabase]

New Recdord []

Set field [foreignKeyID;get (scriptparameter)]

Set field [some other...]

Go to layout [originallayout]

Make sure your button scripparameter is set to the current records primary key ID.

In your related database you can have the field lookup using the forein key and they will populate as soon as the "Set field [foreignKeyID;get (scriptparameter)]"

Hope this helps

Edited by Guest

  • Author

Thanks.

-Graham

Edited by Guest

  • Author

I just can't seem to get the exact syntax of the 'Go To Layout' correct. It never switches to the other database.

If my other db name is "Nursery Products" and it contains a table called "Plant Catalog" and a lyout called "Form View", exactly what should I put as the parameter to the 'Go To Layout' function.

Many Thanks.

Go to Layout will only go to layouts defined in the current file. If you need to go to a layout in another file then you need to make a go to layout script in the other file and call that script from the current file.

  • Author

Thanks.

It seems like I cannot create a new record on the other table either - I guess this all has to go in the other database's script?

Earlier you said that the table in the other file is related.

If so, you can create a layout for it in the current file.

Either way, you can create records in related tables directly - if the relationship is defined to allow creation of records.

Let's go back to your original post. You say that you want to create a new record in a related database and populate its fields with values from the existing record. Does this mean that you are trying to create a new record related to the current record? If that is the case then a portal into your related file is probably the answer to your problem. In fact the fields that you wish to duplicate can be made into match fields and they will be automatically duplicated whenever you enter data into a non-match field in a empty portal row,

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.