pentaho/pentaho-kettle · error · KettleException

SalesforceInsert.CanNotFindField

Error message

SalesforceInsert.CanNotFindField

What it means

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]'.

Solutions

  1. Check the field name in the error message and confirm it exists in the step's input row (use 'Show input fields' in Spoon)
  2. Update the Salesforce Insert mapping to match the actual upstream field names exactly (case included)
  3. Add a 'Select values' step to rename/add the missing field before Salesforce Insert

Example fix

// before
mapping expects: "CustomerId"
// after
rename upstream field or set mapping to the real name: "Customer_Id"
Defensive patterns

Strategy: validation

Validate before calling

RowMetaInterface inputRowMeta = transMeta.getPrevStepFields(stepMeta);
for (String streamField : insertMeta.getUpdateStream()) {
  if (inputRowMeta.indexOfValue(streamField) < 0) {
    throw new IllegalStateException("Field missing from input: " + streamField);
  }
}

Try / catch

try {
  trans.execute(null);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("CanNotFindField")) {
    log.error("Upstream field rename detected; fix Salesforce Insert mapping", e);
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/d82fe5a19f4aefab. Report an issue: GitHub.

Appendix: source

Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsert.java:95

      // Check if field list is filled
      if ( data.nrfields == 0 ) {
        throw new KettleException( BaseMessages.getString(
          PKG, "SalesforceInsertDialog.FieldsMissing.DialogMessage" ) );
      }

      // Create the output row meta-data
      data.inputRowMeta = getInputRowMeta().clone();
      data.outputRowMeta = data.inputRowMeta.clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Build the mapping of input position to field name
      data.fieldnrs = new int[meta.getUpdateStream().length];
      for ( int i = 0; i < meta.getUpdateStream().length; i++ ) {
        data.fieldnrs[i] = getInputRowMeta().indexOfValue( meta.getUpdateStream()[i] );
        if ( data.fieldnrs[i] < 0 ) {
          throw new KettleException( BaseMessages.getString( PKG, "SalesforceInsert.CanNotFindField", meta
            .getUpdateStream()[i] ) );
        }
      }
    }

    try {
      writeToSalesForce( outputRowData );

    } catch ( Exception e ) {
      throw new KettleStepException( BaseMessages.getString( PKG, "SalesforceInsert.log.Exception", e ) );
    }
    return true;
  }

  @VisibleForTesting
  void writeToSalesForce( Object[] rowData ) throws KettleException {
    try {

View on GitHub (pinned to f3058517a1)