+ Start a Discussion
gsarguccigsargucci 

Problem moving a package/deploying a custom object -- stuck!

I need to move the source code making up a managed package to another org, so that I can create a new package (with a different namespace) after making some changes.  I have a custom object with several fields that are all 'Lookup(User)'.  The child relationship names for all of these fields somehow ended up being the same.  I don't know how that happened, why SF let us do it in the first place, etc.--but I'm now stuck in the following situation:

 

- The object has multiple fields with the same relationship name

- When I try to deploy this object to the new org, I get the following error:

    # Deploy Results:
    File Name:    objects/Work_Order__c.object
    Full Name:  Work_Order__c.Assigned_Installation_Manager__c
    Action:  NO ACTION
    Result:  FAILED
    Problem: Duplicate relationship name: Work_Orders
- I cannot change the relationship name (or delete the field) in the source org, because it's a part of a managed, released package

 

Could anyone offer any suggestions on how to get past this?  Maybe I'm overlooking something.

 

Thank you in advance!

TLFTLF

Are you using the Force.com IDE to try to move your code? If so, you might be able to try the following:

 

  1. Turn off the "Build Automatically" feature in Force.com IDE so automatic saving to the server is disabled.
  2. Hand edit the metadata files for your custom objects retrieved from the source org (the one containing the code you want to migrate) to rename the child relationships in the metadata file.
  3. Deploy the modified metadata files to your destination org.

Hope this helps.