0

I have a custom object called Product with Record Types (RecordTypeId). On this object, I have two record types: Standard and Model.

My product.csv:

Name,Code__c,Family__r.Code__c,RecordTypeId
TV,TV,tv,Standard
GameConsole,GameConsole,gameconsole,Standard
MenShirt,MenShirt,menshirt,Model
LadyShirt,LadyShirt,lady_shirt,Model

When I executed this command:

sfdx force:data:bulk:upsert -s Product__c -f csv/product.csv -i Code__c -w 2

I got an error:

=== Upsert errors
MALFORMED_ID:Record Type ID: id value of incorrect type: Standard:RecordTypeId --
MALFORMED_ID:Record Type ID: id value of incorrect type: Standard:RecordTypeId --
MALFORMED_ID:Record Type ID: id value of incorrect type: Model:RecordTypeId --
MALFORMED_ID:Record Type ID: id value of incorrect type: Model:RecordTypeId --

Usually, I have no issue importing other records if there is no "RecordTypeID" field on it. This is the first time I importing records with RecordTypeID. How do I resolve this?

0
3

Update:- Make sure to use 18 digit id when you are doing an upsert.

Description :- Users may encounter the following errors when working in Data Loader:

MALFORMED_ID: Object name id: id value of incorrect type.
MALFORMED_ID:bad id.
MISSING_ARGUMENT:Id not specified in an update call.
INVALID_CROSS_REFERENCE_KEY: invalid cross reference id.

Resolution :- Salesforce records are either 15 or 18 characters in length.

Typically when viewed within the organization, they are 15 characters: 00300000003T2PG. When viewed through Data Loader, API, or Apex, they are 18 characters: 00300000003T2PGAA0.

When you use a 15-character, the system may convert the value to the 18-character representation. Invalid IDs will be rejected with one of the above errors.

Scenarios: CSV file contains an invalid ID in the ID column or the column

ID with invalid characters or ID with length less than 15 characters

  • "Insert/Update" operation error: MALFORMED_ID: Object name id: id value of incorrect type
  • "Delete" operation error: MALFORMED_ID:bad id

Error resolutions:

  • Visit the record in the Organization to verify the ID entered. Keep in mind that these IDs are case sensitive.
  • Manually convert the 15-character ID to an 18-character ID. See article on how to Convert 15-character ID to 18-character ID
  • Verify that the correct field is mapped in Data Loader. If you inadvertently mapped a Text column to a Lookup field, this error might be thrown.

Missing ID (Blank)

  • Error: MISSING_ARGUMENT:Id not specified in an update call.

  • Error Resolution: Enter a valid ID (ID should not be blank)

Incorrect ID (Update/Upsert)

  • Error: INVALID_CROSS_REFERENCE_KEY: invalid cross reference id.

  • Error Resolution: ID should be correct (existing ID) and the Owner ID listed in the CSV file should have access to the record.

Reference:- Errors due to invalid IDs during Data Loader import and update

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.