+ Start a Discussion
nick stonick sto 

2nd Master-Detail relationship in custom object breaking code

I have recently used Eclipse to move a working Visualforce application to a new org.  The transfer went smoothly for the most part once I removed the namespace references.  A problem seems to have occurred with one of my custom objects.  This object is used as a many-to-many link between another custom object in our application, and the Contact object. 

 

I realized one of our querys of this object was not returning anything.  I began using Apex Explorer to attempt to isolate the failure.  What I found was that the object was not appearing on the list of objects for the org.  After reading some other posts here, I attempted to delete and recreate the object.  What I eventually found was that if I create the object new, it appears in the Explorer.  After adding a 1st Master-Detail, it still exists.  When I add the 2nd Master-Detail however, it suddenly disappears from the list and queries involving the object fail with INVALID_TYPE errors.  Deleting the 2nd Master-Detail field causes the object to reappear in the list and queries to work succesfully.  From this I can only assume that for some bizarre reason the 2nd Master-Detail field is causing an error with the object.  If anyone has any experience with this issue or work-arounds I would be grateful.  This error is especially a problem because this is a working application in another org and it is not feasible for us to redesign around the issue.