September 11, 201213 yr Newbies Hi, I need to write a script that (based on a unique key defined by user in a field of the current record) copy a field from the record that match the key in the same field in the current record. E.g.: I have a table "Contracts", the user is inserting a new contract, he choose another contract by a self-relationship of the table "Contracts" and my script have to copy the field "PaymentMethod" from the other contract in the current contract. This is only an example to simplify the understanding, the real problem is more complex. Thanks in advance.
September 11, 201213 yr How about Set Field[PaymentMethod; SelfJoin::PaymentMethod] Note that this method requires that one of the predicates in the selfjoin relationship is Contracts::ID ≠ SelfJoin::ID.
September 11, 201213 yr he choose another contract by a self-relationship of the table "Contracts" If you have a self-join relationship of the Contracts table, then all the data from the related record is available through that relationship. Not sure why you would need to copy it. Note that this method requires that one of the predicates in the selfjoin relationship is Contracts::ID ≠ SelfJoin::ID. I am not sure of that - I think it depends on what the self-join relationship is based upon.
Create an account or sign in to comment