4

I am writing a custom email service. I can get the incoming csv file and parse it down to rows and then columns. I do my thing, then I try to insert the objects (I know they are all original, the data has been de-duped already).

When I go to preform my insert, I get the following DML exception.

System.DmlException: Insert failed. 
First exception on row 0; 
first error: UNKNOWN_EXCEPTION,
INVALID_TYPE: sObject type 'DataDotComEntitySetting' is not supported

What the heck is "DataDotComEntitySetting." I have no idea what that is or where I am using/setting it. Does it have to do with the fact that I am using sObject as the container? We do have Data.com setup in org.

I am sure I am just missing something....

THANKS IN ADVANCE FOR ANY HELP!

~Red

Here is the code that causes the above DML exception:


public static list<sObject> csvTosObject(List<List<String>> parsedCSV, string objectType){

    Schema.sObjectType objectDef = Schema.getGlobalDescribe().get(objectType).getDescribe().getSObjectType();
    system.debug('================================================================================== You want me to make a '+objectDef);

    list<sObject> objects = new list<sObject>();
    list<string> headers = new list<string>();

    for(list<string> row : parsedCSV)
    {
        for(string col : row)
        {
            headers.add(col);
        }
        break;
    }
    system.debug('================================================================================== File Column Headers');
    system.debug(headers);

    integer rowNumber = 0;
Integer rowCount = 0;

    for(list<string> row : parsedCSV)
    {
        if(rowNumber == 0)
        {
            rowNumber++;
            continue;
        }
        else
        {
 system.debug('================================================================================== Row Index: ' + rowNumber);
            sObject thisObj = objectDef.newSobject();
            integer colIndex = 0;
string headerName;
String ftoHeader;

            for(string col : row)
            {                   
ftoHeader = headers[colIndex].trim();
                      system.debug('================================================================================== Column Name ' + ftoHeader);

                if(ftoHeader.length() > 0){

                if(ftoHeader == 'ReferenceNumber'){
                headerName = 'FTO_Tracking_Number__c';

}else if(ftoHeader == 'SubmitDate'){
                headerName = 'FTO_Date_Received__c';

}else if(ftoHeader == 'FirstName'){
                headerName = 'FirstName';

}else if(ftoHeader == 'LastName'){
                headerName = 'LastName';

}else if(ftoHeader == 'JobFunction'){
                headerName = 'Role__c';

}else if(ftoHeader == 'JobTitle'){
                headerName = 'Title';

}else if(ftoHeader == 'CompanyName'){
                headerName = 'Company';

}else if(ftoHeader == 'Email'){
                headerName = 'Email';

}else if(ftoHeader == 'Phone'){
                headerName = 'Phone';

}else if(ftoHeader == 'Fax'){
                headerName = 'Fax';

}else if(ftoHeader == 'Address'){
                headerName = 'Street';

}else if(ftoHeader == 'City'){
                headerName = 'City';

}else if(ftoHeader == 'State'){
                headerName = 'State';

}else if(ftoHeader == 'Country'){
                headerName = 'Country';

}else if(ftoHeader == 'ZipCode'){
                headerName = 'PostalCode';

}else if(ftoHeader == 'RequestType'){
                headerName = 'FTO_Inquiry_Type__c';

}else if(ftoHeader == 'ProductDescription'){
                headerName = 'FTO_Product__c';

}else if(ftoHeader == 'RequestSpecifics'){
                headerName = 'FTO_Specifics__c';

}else if(ftoHeader == 'PreferredContactMethod'){
                headerName = 'FTP_Contact_Method__c';

}else if(ftoHeader == 'Industry'){
                headerName = 'Industry';

}else if(ftoHeader == 'ProductDescription'){
                headerName = 'FTO_Content__c';

}else{
                headerName = 'NO';
system.debug('================================================================================== Skipping column '+ftoHeader);
                }                  

if( headerName != 'NO'){
system.debug('================================================================================== Adding to Object for insert');
try {                       
thisObj.put(headerName,col.trim());
system.debug('=================================================================================='+ftoHeader+' column mapped to ' + headerName);
                   }
                   catch(exception e){
                       system.debug('================================================================================== No corresponding SFDC field specified in header');                           
                   }
}
colIndex++;
                }
            } 
//Add to collection for processing
            objects.add(thisObj);
            rowNumber++;
rowCount++;
        }       
    }
try
{
    insert objects;
    system.debug('=================================================================================='+rowCount+' Records Inserted');
}
catch(exception e)
{
System.debug('================================================================================== insert FAILED');
}
    return null;
}

}
4

According to this very recent blog post, this looks like a platform bug, the solution to which is

turning off the "Clean" feature in data.com

Please leave a comment on this question, as well as this earlier question, if that works. Apparently a few people have run into it.

| improve this answer | |
  • PS - It's too bad though, we actually use the Clean feature... – Red2678 Mar 19 '13 at 1:34
  • File a Case on it anyway, that will help it get prioritized. – jkraybill Mar 19 '13 at 1:36
  • I did. Gave them links to this thread :) – Red2678 Mar 19 '13 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.