From the Parent record's layout you can check for the existance of related records:
If [ Not IsEmpty ( RelatedTable::FieldThat'sNeverEmpty ) ]
Set Variable [$PrimaryKey ; ParentTable::Primarykey ]
Go To layout [ Layout for related table ]
Set Field [ RelatedTable::ForeignKey ; $PrimaryKey ]
Go To Related Records [
Of course, with a portal to the related table, you can also view and create related records directly from the parent table's layout.
I followed earlier advice from PhilModJunk in response to a question about how to create a new related record with an auto-populated ID field. Similar to this one, but without the IF, THEN. That was working, but I then came across the problem that Reggie describes if I wanted to go back to the Layout (i.e., it tried to create another new record)
I have now modified my script to follow the example above from PhilModJunk, as follows:
If [Not IsEmpty(RelatedRecord::ID field)]
Set Variable[$ID; Value:ParentRecord::ID field]
Go to Layout [“RelatedRecord” (ChosenLayout)
Set Field [RelatedRecord::ID field; $ID]
Go to Related Record [From table: “RelatedRecord”; Using layout: “RelatedRecord” (ChosenLayout)]
However, I am still getting a new blank record created even if that record already has been created. Can anyone see where I might be going wrong?