{"record":{"id":"5fd3de03154ece40","repo":"pentaho/pentaho-kettle","slug":"salesforcedelete-error-cannotfindfdeletekeyfield","errorCode":null,"errorMessage":"SalesforceDelete.Error.CanNotFindFDeleteKeyField","messagePattern":"SalesforceDelete\\.Error\\.CanNotFindFDeleteKeyField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforcedelete/SalesforceDelete.java","lineNumber":82,"sourceCode":"      data.deleteId = new String[meta.getBatchSizeInt()];\n      data.outputBuffer = new Object[meta.getBatchSizeInt()][];\n\n      // Create the output row meta-data\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n                      metaStore );\n\n      // Check deleteKeyField\n      String realFieldName = environmentSubstitute( meta.getDeleteField() );\n      if ( Utils.isEmpty( realFieldName ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"SalesforceDelete.Error.DeleteKeyFieldMissing\" ) );\n      }\n\n      // return the index of the field in the input stream\n      data.indexOfKeyField = getInputRowMeta().indexOfValue( realFieldName );\n      if ( data.indexOfKeyField < 0 ) {\n        // the field is unreachable!\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SalesforceDelete.Error.CanNotFindFDeleteKeyField\", realFieldName ) );\n      }\n    }\n\n    try {\n      writeToSalesForce( outputRowData );\n    } catch ( Exception e ) {\n      throw new KettleStepException( BaseMessages.getString( PKG, \"SalesforceDelete.log.Exception\" ), e );\n    }\n    return true;\n  }\n\n  private void writeToSalesForce( Object[] rowData ) throws KettleException {\n    try {\n\n      if ( log.isDetailed() ) {\n        logDetailed( BaseMessages.getString( PKG, \"SalesforceDelete.Log.WriteToSalesforce\", data.iBufferPos, meta\n          .getBatchSizeInt() ) );","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforcedelete/SalesforceDelete.java#L64-L100","documentation":"After resolving the configured delete key field name, processRow looks it up in the incoming row stream via getInputRowMeta().indexOfValue(). This error is thrown when the field name is configured but is not present in the input rows, so the step cannot locate the Salesforce record IDs to delete.","triggerScenarios":"The delete key field name (after variable substitution) does not exactly match any field in the input row metadata — wrong name, wrong case, or the upstream step no longer produces the field.","commonSituations":"Renaming an upstream field without updating the Delete step; extra spaces in the configured field name; the field is only available after a Select Values step that was removed; case-sensitive mismatch between configured name and stream field.","solutions":["Ensure the upstream step actually emits the configured key field (check with a preview/Get Fields)","Correct the 'Key field' name in the Delete step dialog to exactly match the stream field name (case and spelling)","Insert or repair a Select Values / Field renamer step so the ID field reaches the Delete step with the expected name","Trim whitespace from the configured field name"],"exampleFix":"// before: configured name does not exist in the stream\nmeta.setDeleteField(\"ID \");\n// after: exact match with the field produced upstream\nmeta.setDeleteField(\"Id\");","handlingStrategy":"validation","validationCode":"// before the Delete step, assert the field exists in the stream\nRowMetaInterface inputFields = transMeta.getPrevStepFields(stepName);\nif (inputFields.indexOfValue(realFieldName) < 0) {\n  throw new IllegalStateException(\"Field '\" + realFieldName + \"' not found in input stream of Salesforce Delete step\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  executeTransformation();\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CanNotFindFDeleteKeyField\")) {\n    logError(\"Key field missing from input rows; check upstream field names: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Preview upstream steps to confirm the ID field name and casing match the configured key field","Avoid renaming upstream fields without updating dependent Delete steps","Use a Select Values step to pin the exact field name right before the Delete step","Run the step's field verification in Spoon before production runs"],"tags":["salesforce","delete","field-not-found","row-metadata"],"backgroundTag":"record-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}