Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Creating related records conditionally?


This topic is 8109 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Is there a way to create a record in a related file conditionally?

For example: If two files (File A and File B) are joined by a primary key ID. In File A... If field_ONE="1" , then create a new record in the related file B and display the contents of FIELD_X and FIELD_Y in File B. Else if FIELD_ ONE contains any other value, do not create a record in the related File B. Thanks in advance...

Posted

There are two ways to create a related record:

1) Use a script, in which case the script can perform whatever tests you wish before creating the related record

2) Attempt to write to a related field (Relationship::FIELD_X or Relationship::FIELD_Y) on a layout. If the corresponing relationship is set to "allow creation of related records" AND no related records currently exist, on will be created using the primary(left side) key. This key can be a calculated field:

cKey (calculation, stored) = If(field_ONE = 1, Key, "")

If related records already exits, the contents of FIELD_X and FIELD_Y of the first matching record will be displayed and another new record WILL NOT be created.

-bd

This topic is 8109 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.