You need to sign in to do that
Don't have an account?
Dhilip Dussa
Need help on inserting record
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
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
From the error message, i looks like its issue is not in contact insert, since id value of incorrect type: a4D..
Contact object prefix is 003. but it says a4D, it could be custom object.
In case, if there is any dependent logic or process builder or flow etc, which gets triggered because of inserting contact, could fail this.
Try the debug log and check it, if not you can post the debug log error message line here.
If it solves the problem, mark it as resolved.
Thanks
For example, some fields in Salesforce can only accept certain ID types (e.g., Contact ID, Account ID, etc.). If you map a value for an ID of a different type, you will see this error.
Please check if the correct values are being passed in your code
You can use Entity Key prefix decoder to look up the entity name
Salesforce Support