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:
whereas, in order to use the external ids in the same way as I have been doing, I would need:
Does anyone know why I am not being offered this method signature?
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.