You need to sign in to do that
Don't have an account?

Upsert with multiple external_id
Hi,
I am upserting records in a custom object using Apex in Visualforce.
The custom object has columns i.e. CustName & Month which are together used as primary key to identify unique record in table. I am updating already existing records based on this combined key or inserting new if table dont have such record.
Can I use two external Id's like follows to do same:
Upsert CustomerTab__c CustName__c , Month__c;
I am facing error like
Error: Compile Error: Variable does not exist: Month__c at line 353 column 35
I have both variables having External Id option selected.
Anybody has any solution for this?
Thanks.
I am upserting records in a custom object using Apex in Visualforce.
The custom object has columns i.e. CustName & Month which are together used as primary key to identify unique record in table. I am updating already existing records based on this combined key or inserting new if table dont have such record.
Can I use two external Id's like follows to do same:
Upsert CustomerTab__c CustName__c , Month__c;
I am facing error like

I have both variables having External Id option selected.
Anybody has any solution for this?
Thanks.
All Answers
A child object can have two master-detail relationships. In data loader it is possible to specify an external id for each relationship when upserting child records.
Does this mean the equivalent is not possible in apex code?