February 20, 200421 yr Im jsut bad with the logic of scripts... I havd DB a and DB b with a relationship betwen the Last_Name field trying to figure out how to make a button in DB a that goes to related record in DB b. This is easy enought to do. However, if there is NO related record it currently does nothing. I would like it to do something. Like if there is no related record go to the first record. thanks!
February 20, 200421 yr Hey Steve, Here is your solution. Test.fp5 perform the related records script "New." If there is not a related record in test2.fp5 then it will show the first record. Justin Grewe examplescripts.zip
February 20, 200421 yr Steve ... Here's a variation on Justin's example. I'll repeat something that's been said over and over here: don't use names of any kind as the relational key field. Names change, and your relationships can break as a result. Relationships are best built between values that will never change. That said, in this little demo, the "gRR_name" script first checks if there are any related records. If not, it gives the user options for how to proceed. It's just a simple example of how to handle situations where there are no related records. Main_Related.zip
Create an account or sign in to comment