I'm trying to upser a list of Asset records via Database.upsert(List, externalIdField, boolean) and on the externalIdField, I want to pass the standard field 'SerialNumber'.
List<Database.UpsertResult> upsertAssetResult = Database.upsert(finalAssetList, Asset.SerialNumber, false);
However, an error occurred saying an External Id custom field OR a Standard Indexed field must be used.
Invalid field for upsert, must be an External Id custom or standard indexed field: SerialNumber
Now if you go to the Asset standard object, you will see that SerialNumber is an INDEXED standard field and if we believe the error message, it can be used.
Am I missing something? OR is the error message is incorrect and that only External Id custom fields are allowed?