AnsweredAssumed Answered

Create record in related table

Question asked by crichter on Jun 11, 2014
Latest reply on Jun 17, 2014 by crichter


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.

     Thank you,




     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) ]
        New Record/Request
        Set Field [ Transgenes::NP#; $ParentID ]
     End If