• Lahiru Bandara
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm getting above error message when I try to create child records based on the External Id of the Parent Record. Here is the scenario. Please note that both reference1 and reference2 are related to the same Master object (Master_record__c). And reference1 is Master-Detail relationship and reference2 is just a lookup to Master record
String aExtId = helper.createMasterRecord(param1, param2);//Master Record (Master_record__c) creates with the External Id Child_rec__c aRec = new Child_rec__c(); aRec.reference1__r = new Master_record__c(External_Id__c = aExtId); aRec.reference2__c = 'a2w2C0000005vaVQAQ'; objectsToInsert.add(aRec); //Same List has the Master record to be inserted too.
Here's what happens inside the createMasterRecord()
Master_record__c aMaster = new Master_record__c(); aMaster.Name = 'Test'; code.. code.. aMaster.External_Id__c = 'random text'; return aMaster.External_Id__c;
Any idea how to fix this?
using triggers how to get the list of remaining contacts seperated by "," in custom field created in accountobject related to contact obj