Set Variable[ $ID ; maintable::ID ]
Go To Layout[ relatedTableLayout ]
Set Field[ ID_Main ; $ID ]
Go To Layout[ Original ]
It works (didn't know you could 'go to a layout' without seeing it on the screen) ... but it seems that the program automatically creates a new record in the maintable (table X) as well.
I print the instructions in my script hereafter for your information (although i think it has more to do with relationships).
Any idea about how to solve this as well?
Thanks a lot for the help so far!
If [p_Muster::M_Rez_ArtNr1 <> 0]
Set Variable [$$M_Id; Value:p_Muster::M_Id]
Set Variable [$$M_Rez_ArtNr1; Value:p_Muster::M_Rez_ArtNr1]
Go to Layout [LayoutObjectNames ("p_Inventory";"dbase")]
Set Field [p_Inventory::z_artnr; $$M_Rez_ArtNr1]
Set Field [p_Inventory::comment; $$M_Id&" some comment"]
Go to Layout ["p_Muster" (p_Muster)]