{"record":{"id":"d82fe5a19f4aefab","repo":"pentaho/pentaho-kettle","slug":"salesforceinsert-cannotfindfield","errorCode":null,"errorMessage":"SalesforceInsert.CanNotFindField","messagePattern":"SalesforceInsert\\.CanNotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsert.java","lineNumber":95,"sourceCode":"\n      // Check if field list is filled\n      if ( data.nrfields == 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SalesforceInsertDialog.FieldsMissing.DialogMessage\" ) );\n      }\n\n      // Create the output row meta-data\n      data.inputRowMeta = getInputRowMeta().clone();\n      data.outputRowMeta = data.inputRowMeta.clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n                      metaStore );\n\n      // Build the mapping of input position to field name\n      data.fieldnrs = new int[meta.getUpdateStream().length];\n      for ( int i = 0; i < meta.getUpdateStream().length; i++ ) {\n        data.fieldnrs[i] = getInputRowMeta().indexOfValue( meta.getUpdateStream()[i] );\n        if ( data.fieldnrs[i] < 0 ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"SalesforceInsert.CanNotFindField\", meta\n            .getUpdateStream()[i] ) );\n        }\n      }\n    }\n\n    try {\n      writeToSalesForce( outputRowData );\n\n    } catch ( Exception e ) {\n      throw new KettleStepException( BaseMessages.getString( PKG, \"SalesforceInsert.log.Exception\", e ) );\n    }\n    return true;\n  }\n\n  @VisibleForTesting\n  void writeToSalesForce( Object[] rowData ) throws KettleException {\n    try {\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsert.java#L77-L113","documentation":"For each stream field configured in the step, processRow() resolves its index in the incoming row via getInputRowMeta().indexOfValue(). If indexOfValue returns -1 the configured field does not exist in the actual input row, and the step throws 'Can not find field [name]'.","triggerScenarios":"processRow() with a stream field name in meta.getUpdateStream() that is absent from the incoming row's RowMeta — e.g. upstream step renamed/removed the field, or the mapping references a case-mismatched name.","commonSituations":"Renaming a field in an upstream step (Select values / Text file input) without updating Salesforce Insert; column removed by a filter or join; case-sensitivity mismatch in field names.","solutions":["Check the field name in the error message and confirm it exists in the step's input row (use 'Show input fields' in Spoon)","Update the Salesforce Insert mapping to match the actual upstream field names exactly (case included)","Add a 'Select values' step to rename/add the missing field before Salesforce Insert"],"exampleFix":"// before\nmapping expects: \"CustomerId\"\n// after\nrename upstream field or set mapping to the real name: \"Customer_Id\"","handlingStrategy":"validation","validationCode":"RowMetaInterface inputRowMeta = transMeta.getPrevStepFields(stepMeta);\nfor (String streamField : insertMeta.getUpdateStream()) {\n  if (inputRowMeta.indexOfValue(streamField) < 0) {\n    throw new IllegalStateException(\"Field missing from input: \" + streamField);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"CanNotFindField\")) {\n    log.error(\"Upstream field rename detected; fix Salesforce Insert mapping\", e);\n  }\n}","preventionTips":["Re-check downstream steps' mappings whenever an upstream step renames or removes a field","Use consistent field naming (watch case sensitivity) across the transformation","Add a Select values step to explicitly define the field contract before Salesforce steps"],"tags":["kettle","salesforce","field-mapping","validation"],"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"}