{"record":{"id":"5843723bde99b328","repo":"pentaho/pentaho-kettle","slug":"salesforceupsert-fieldnotfound","errorCode":null,"errorMessage":"SalesforceUpsert.FieldNotFound","messagePattern":"SalesforceUpsert\\.FieldNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java","lineNumber":104,"sourceCode":"\n      // Check if field list is filled\n      if ( data.nrfields == 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SalesforceUpsertDialog.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, \"SalesforceUpsert.FieldNotFound\", meta\n            .getUpdateStream()[i] ) );\n        }\n      }\n    }\n\n    try {\n      writeToSalesForce( outputRowData );\n    } catch ( Exception e ) {\n      throw new KettleStepException( BaseMessages.getString( PKG, \"SalesforceUpsert.log.Exception\" ), e );\n    }\n    return true;\n  }\n\n  @VisibleForTesting\n  void writeToSalesForce( Object[] rowData ) throws KettleException {\n    try {\n\n      if ( log.isDetailed() ) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java#L86-L122","documentation":"Thrown in SalesforceUpsert.processRow when one of the fields named in the step's update mapping does not exist in the incoming row's row-meta (indexOfValue returns < 0). The step builds a fieldname→index map and aborts rather than silently skipping a mapped field.","triggerScenarios":"A stream field listed in the step's 'stream field' mapping column was renamed or removed upstream in the transformation, so getInputRowMeta().indexOfValue(name) returns -1 on the first data row.","commonSituations":"Renaming a field in a Select Values/Calculator step without updating the upsert mapping; source column dropped when upstream file/API schema changed; case-sensitivity mismatch between the mapping and the actual field name.","solutions":["Read the message's field name and add/restore that field on the stream feeding the upsert step.","Open the Salesforce Upsert dialog and update the mapping to an existing incoming field name.","Check upstream steps (Select Values, filter, renamed CSV headers) that may have removed or renamed the column.","Ensure field name casing matches exactly — Kettle field lookups are case-sensitive."],"exampleFix":"// before: upstream renamed field\n\"oldName\" -> Select Values rename -> \"customerName\" // upsert still maps \"oldName\"\n// after: update the upsert mapping\n<stream>customerName</stream>  // was <stream>oldName</stream>","handlingStrategy":"validation","validationCode":"for (String fieldName : meta.getUpdateStream()) {\n  if (prevRowMeta.indexOfValue(fieldName) < 0) {\n    throw new KettleException(\"Field missing from input stream: \" + fieldName);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { return processRow(row); } catch (KettleException e) { if (e.getMessage().contains(\"FieldNotFound\")) { log.error(\"Add the missing field upstream: \" + extractFieldName(e.getMessage())); } throw e; }","preventionTips":["Pin field names with a 'Field exists' check or Select Values step upstream","Update the upsert mapping whenever upstream field names change","Match field name casing exactly"],"tags":["pentaho","kettle","salesforce","field-mapping","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"}