June 11, 201312 yr 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.
June 11, 201312 yr Auto-entry should work unless you have a reference to something that it cant grab the value for. What is your auto-entry calc?
June 11, 201312 yr 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"
June 11, 201312 yr 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
June 11, 201312 yr 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.
June 11, 201312 yr 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...
June 11, 201312 yr 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?
June 12, 201312 yr The file is not read only. Though perhaps you are unfamiliar with unzipping a compressed file?
June 12, 201312 yr 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