1 Reply Latest reply on Oct 29, 2012 12:42 PM by philmodjunk

    Testing for a related record

    kashaev

      Title

      Testing for a related record

      Post

           I have a DB that I want to create related records for in a seperate table.  Is there a way to have a script check for an existing related record and if one does not exist, make one...but,  if it does exist,  simply return that record in a specific layout?

            

            

            

        • 1. Re: Testing for a related record
          philmodjunk

               And should the script bring up the new record in that specific layout after creating it? (When a related record did not exist.)

               If so, Say you have this relationship:

               ParentTable::__pkParentID = Child::_fkParentID

               and you enable "allow creation of records via this relaitonship" for the Child table.

               Then This this script step:

               Set Field [Child::_fkParentID ; ParentTable::__pkParentID]

               Will create a new related record if no related record exists and will set the _fk field to the value that it already has if it does exist. Then your remaining script steps might be:

               Commit Records
               Go To Related Records [//specify child table and layout for child table options here]