I've been using the SOAP API to load different SObjects into an org. When I have a relationship, I can normally use an external ID as follows in order to set up relationships that exist between objects:
Opportunity opp = new Opportunity();
Account acc = new Account();
acc.setExternalId__c(ACC_EXT_ID);
opp.setAccount(opp);
This creates a lookup from an opportunity to an account that I have the external id for.
however, for some reason I have run into a situation where the API is not offering me a setter method with a signature that I can use to perform the above.
I am being offered:
myCustomObj.setAnotherCustomObj__c(String AnotherCustomObj__c)
and
myCustomObj.setAnotherCustomObj__r(QueryResult AnotherCustomObj__c)
whereas, in order to use the external ids in the same way as I have been doing, I would need:
myCustomObj.setAnotherCustomObj__r(AnotherCustomObj__c anotherCO)
Does anyone know why I am not being offered this method signature?
Thanks
EDIT:
As @superfell suggested, I'll post the field definition:


In addition, and along the same lines, I have run into an issue trying to set the Owner of the Order_Status__c object using an external ID. I was hoping to be able to do the following:
Order_Status__c orderStatus = new Order_Status__c();
User owner = new user();
owner.setUserExtId__c(USER_EXT_ID);
orderStatus.setOwner(owner);
yet I am not being offered a method on the Order_Status__c object whereby I can set the owner using a User object. Instead the methods I am being offered by the SOAP API are:
setOwner(String Owner__c)
setOwner(Name Owner)
setOwnerId(String OwnerId)
In order to use these method, I would first have to select information (e.g. the owner id) from the database, whereas I would ideally like to set the Owner using an external id which I would already have.
AnotherCustomObj__c)? If you do - maybe you've marked it as ext. id it after you downloaded the WSDL - can you obtain fresh one and regenerate your classes? – eyescream Jan 29 at 12:48