Loading

Error: "Cannot invoke 'Object.toString()' because the return value of 'common.api.soap.Entity.getField(String)' is null" when sending emails with Rich Text for Case Comments enabled

Publish Date: May 28, 2026
Description

Here are the steps to reproduce

  1. Navigate to SetupSupport Settings.
  2. Enable the setting:
    • Rich Text for Case Comments
  3. Create a Case record.
  4. Insert a blank CaseComment record against the Case using API

    Note: Salesforce UI does not allow creation of blank Case Comments because the Comment Body field is required in the standard interface.

  5. Open the Case record.
  6. Attempt to send an email from the Case using the standard email action.
  7. Observe that the email action fails and the following error is displayed:

    "Cannot invoke "Object.toString()" because the return value of "common.api.soap.Entity.getField(String)" is null"
Resolution

Review the processes responsible for creating Case Comments and ensure that blank comments are not inserted into the org. Validate that the Comment Body field contains a value before inserting a Case Comment.

You may consider implementing a before insert trigger or validation mechanism on the CaseComment object to prevent insertion of blank case comment.

Knowledge Article Number

005385609

 
Loading
Salesforce Help | Article