• Petra jany
  • NEWBIE
  • 0 Points
  • Member since 2021
  • Assignment Writing Service


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

I'm facing one issue while inserting a record.

I have once Multi-select picklist,
if select anyone i need to create one more record with the same name

the first time it is inserting fine,
but if try next time getting an error
Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Special Initiative: id value of incorrect type: a4D6C000000DMXJUA4

please help me,

List<Contact> mrl = new List<Contact>();

for(Integer i=0; i<wrapperList.size(); i++){
            System.debug('mkList===========>>>>>>'+mkList);
            Contact mr = new Contact();
            mr.name = wrapperList[i];
            mr.Account = wrapperList[i];
            mr.Opportunity__c = recordId;
            mrl.add(mr);
        }
        if(!mrl.isEmpty()){
            Insert mrl;
        }

I'm inserting name with accountId only

Thanks,
Dhilip