related record issue works intermittently

Discussion created by burghfan on Sep 19, 2016
Latest reply on Sep 22, 2016 by BruceRobertson

We two (2) tables; "Rep Orders" and "Distributor Orders" that are linked to a "Estimate" Table.


From the "Estimate" table we can generate either a new "Rep" or "Distributor" order.


We several scripts that allow us to move between the related records in the "Estimate Table" and the "Rep Order" or "Distributor Order" The issue we are having is that the "Go To Related Record" Scripts works correctly as long as we stay in the same two tables Example go from the "Estimates" Table" to the related "Rep Order" and back to "Estimates" is fine. If we switch to the Distributor Order" table the script for some reason takes us to the last "Estimate" record associated form a "Rep Order". The same holds true if starting out between "Distributor Order" and Estimate" then the issue is that the "Rep Order" goes to the last "Estate" associated with the "Distributor Order"


Our Relationships look as follows


Estimate Table

Primary Key: ID_Estimate

Child Key: id_rep_order

Child Key: id_distr_order


Rep Order Table

Primary Key: ID_RepOrder

Child Key: id_rep_estimate


Distributor Order Table

Primary Key: ID_DistrOrder

Child Key: id_distr_estimate


Relationship Table Occurrences


Estimate to Rep Order by Estimate_ID

ID_Estimate = id_rep_estimate


Estimate to Distributor Order by Estimate_ID

ID_Estimate = id_distr_estimate


Estimate to Rep Order by Order_ID

id_rep_order = ID_RepOrder


Estimate to Distributor Order by Order_ID

id_distr_order = ID_Distr_Order


Scripts are as follows:


From Distributor Order back to Estimate

Screen Shot 2016-09-19 at 3.37.56 PM.png

From Estimate to Distributor Order

Screen Shot 2016-09-19 at 3.39.40 PM.png


The 2 Scripts for the Rep Order and Estimate look the same with the corresponding fields in the script steps