Create record in related table
I want to create a new record in a related table only if the related record is not yet existing. I also want to "copy" the KnownPeptides::NP# field content of the current record to the newly created record.
The script below I creates always new blank records in the related table even if there is a related record.
Any help is highly appreciated.
Set Variable [ $ParentID[KnownPeptides::NP#]; Value:KnownPeptides::NP# ]
If [ GetField ( KnownPeptides::NP# ) = $ParentID ]
Go to Related Record [ Show only related records; From table: “Transgenes”; Using layout: “Transgenes” (Transgenes) ]
Else If [ GetField ( KnownPeptides::NP# ) ≠ $ParentID ]
Go to Layout [ “Transgenes” (Transgenes) ]
Set Field [ Transgenes::NP#; $ParentID ]