You need to sign in to do that
Don't have an account?
David_Wu
Error:“Cannot specify both an external ID reference Account__r and a salesforce id, Account__c”
Hi,All.
I created a new object type(such as objectA) that had one field(such as account__c) to refer to some account.When I called API to change one objectA to refer to another account,there was a error:"Cannot specify both an external ID reference Account__r and a salesforce id, Account__c".
code like that(C#):
//the old value of objectA.Account__C is accountA,now set it accountB
objectA.Account__c = accountB.Id;
What is my problem?How to solve it?
Thanks.
I created a new object type(such as objectA) that had one field(such as account__c) to refer to some account.When I called API to change one objectA to refer to another account,there was a error:"Cannot specify both an external ID reference Account__r and a salesforce id, Account__c".
code like that(C#):
//the old value of objectA.Account__C is accountA,now set it accountB
objectA.Account__c = accountB.Id;
What is my problem?How to solve it?
Thanks.
objectA.Account__r = null;
objectA.Account__c = accountB.Id;
NO error.
Thanks.
Hi,
I'am working on a dynamic deep clone funcionality and I'am getting the same error saying 'INVALID_FIELD, Cannot specify both an external ID reference FSLABB_Section__r and a salesforce id, FSLABB_Section__c:'.
In my case I have to specify the FSLABB_Section__r but needs to get rid of FSLABB_Section__c.
I tried emtying the value of FSLABB_Section__c by FSLABB_Section__c = null ;
But it is not working .
Can you please help?
Create a temporary obect reference of your child again, and specify your FSLABB_Section__r.
Code would be something like this.
Child object : FSLABB_SectionChild__c,
Parent Object: FSLABB_Section__c
FSLABB_SectionChild__c tmp = FSLABB_SectionChild__c();
tmp.id = FSLABB_SectionObj.id; // Orignal child record object which you are working;
tmp.FSLABB_Section__r = new FSLABB_Section__c(ExternalIdfield='XXXXXXX');
upsert tmp;