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.

Featured Replies

I have a table (table1) that is related to another table (table2) by its key. When a record is created in table1, a new record is created in table2. This is defined by their relationship.

 

I want the new record in table2 to have some checkbox fields auto-populated.I have tried using the auto-fill option for the specified fields in the related table, but it is not working. The only thing that seems to work is a script with some "Set Field" calls to those fields, but I have only found an "onRecordCommit" script trigger to run this, and I need to to run as soon as the record is created. Is there a better way to do this?

 

Thanks.

Solved by mr_vodka

Go to solution

Auto-entry should work unless you have a reference to something that it cant grab the value for. What is your auto-entry calc?

  • Author

Auto-entry should work unless you have a reference to something that it cant grab the value for. What is your auto-entry calc?

I am just entering data, not a calculation. Right now, as a test, I am just auto-filling with "1"

  • Solution

A child record will not be created automatically just by creating a new parent record unless in the script you can make it create a new child by setting a value in the child.

 

See attached.

child_create.zip

  • Author

A child record will not be created automatically just by creating a new parent record unless in the script you can make it create a new child by setting a value in the child.

 

See attached.

But how would this script you reference be called? I want it to only happen when a record is created, and there is no "OnRecordCreate" script trigger.

Did you see the script? It would be called on Record commit for the parent layout, and only create one when there are no child records.


Furthermore, I still question why you are trying to do this...

  • Author

Did you see the script? It would be called on Record commit for the parent layout, and only create one when there are no child records.

Furthermore, I still question why you are trying to do this...

No, I couldn't see the script because the file was read-only and I couldn't look in the script manager.

Could you type the script out here?

 

I think I understand what I need to do, but I can't figure out how to check if a matching related record exists. Also, if I modify a field in the related table with a key that does not yet exist, will that create a record with that key?

The file is not read only. Though perhaps you are unfamiliar with unzipping a compressed file?

  • Author

Oh, duh. I am sorry, I was in a hurry yesterday and accidently clicked open the compressed folder to the file. DX

 

Thank you, mr_vodka, that script worked! While it does only work after a commit, and I'd prefer it to run as soon as a record is created, it should still be fine. Thanks!

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.