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.

Automatic enter ID ? Need Help with Design!

Featured Replies

Hi Guys,

I've got the following problem:

When I make a new Record in my Related Layout "Invoices", it doesn't enter my ID in its ID-Field from the "Customer" Layout, so that it's related. How can I do such a thing?

Thanks for you're reply! wink.gif

Ron

If I understand you correctly you have 2 tables (not just layouts right?).

Create a second copy of your table "invoices" and create a relationship between this table and the "customer" table, set the relationship to "X" between the fields (instead of =).

then create a script looking like

go to layout (invoices)

new record

set field (invoices::ID; customerX::ID)

...or else you could create a global field in your "customer" table. Then I don't think you need the extra table copy, you could just write your script:

set field (customer::global_ID;customer::ID)

go to layout (invoices)

new record

set field (invoices::ID; customer::global_ID)

I hope this helps....

Put an invoice portal in the customer layout; when you create an invoice there, the customer ID will automatically be entered for the invoice. You do have the primary key and the foreign key connected in the Relationships Graph, don't you?

Didn't know that worked, is there other ways to link records from different tables if you don't want a portal on your layout?

You can, of course, manually connect a new record in the related table or file, by using a pop-up field based on a value list from the primary table or file.

Use the Relationships Graph to make sure the two tables or files are linked. Then in a script you can GTRR (Go To Related Record).

Well, I don't want to do it manually but thanks anyway.

You can put related fields on your layout (not the key field) and enter data. The relationship will be auto-linked and a new related record created. This requires 'Allow creation of related records' to be selected in the relationship's definition.

  • Author

Hi David Holmberg,

hey could you make me a Tutorial File?

Thanks in advance!

Here comes the file you wanted.

-Queue- had a nice idea though.....

test.zip

  • Author

Hi David,

thanks for you're kind Reply and Help!

After a long, long time this is what I came to! It seams a very quick and safe way to do the exact same thing.

Check it out!!! cool.gif

Many appreciations and regards.

R.T.

Copy.with.ScriptParameter.zip

Nice work with the scriptparameter!

Just one thing

The go to Layout step in the GoToRelatedRecord script are not doing any good, it's the other way around....

This script will show all records, not only the related ones. It will also take you to the table 2 layout even if there are no related records.

Remove that step and the script will work fine.

For Number::calc, you can use Right( "000" & number; 4 ) if you always want to have a 4-digit number. You might also want to make this a text result due to the leading zeroes that a number field will ignore.

A lot better, thanks Queue!

  • Author

Yea,

I always do it like that! It seams a very nice and clean way, you're right!

Thanks anyway!

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.