EspoCRM Stream JavaScript Customization

Expand EspoCRM Stream Updates by Default

Eymen Elkum headshot Eymen Elkum
Expanded EspoCRM stream update displaying changed field details

Open EspoCRM field-change notes automatically with an upgrade-safe Custom stream view instead of modifying a core JavaScript file.

EspoCRM collapses the detailed before-and-after values in field-change stream notes. Administrators can change that initial state without editing client/src or another core application file.

This customization maps the Update note type to a Custom view and extends the standard EspoCRM 10 update-note class.

Before you begin

You need filesystem access and a test installation. This is a user-interface preference, not a security control. Users still see only stream notes and fields they are allowed to read.

Step 1: Register the Custom Update note view

Create the following metadata file. If it already exists, merge the Update item view without removing other itemViews, record views, or handlers.

custom/Espo/Custom/Resources/metadata/clientDefs/Note.json

{
    "itemViews": {
        "Update": "custom:views/stream/notes/update-expanded"
    }
}

EspoCRM’s stream list reads clientDefs.Note.itemViews before falling back to the standard view name for a note type.

Step 2: Extend the standard update-note view

client/custom/src/views/stream/notes/update-expanded.js

define(
    'custom:views/stream/notes/update-expanded',
    ['views/stream/notes/update'],
    (UpdateNoteView) => class extends UpdateNoteView {
        setup() {
            super.setup();

            this.isExpanded = true;
        }
    }
);

The standard EspoCRM view already implements the toggle, icon state, field rendering, and access-aware child views. Setting its initial isExpanded state reuses that behavior rather than manipulating .hidden classes directly.

Step 3: Rebuild EspoCRM

Run Administration → Rebuild, then perform a hard reload if the previous JavaScript module is still cached.

Test the result

  1. Open a record whose Stream panel is enabled.
  2. Change a field that is audited and save the record.
  3. Confirm that the new update note shows its details automatically.
  4. Use the chevron to collapse and reopen the details.
  5. Reload the record and confirm the initial expanded state.
  6. Test notes with one field, several fields, and a status change.
  7. Test as a non-admin user with restricted field and record access.
  8. Confirm that the browser console contains no related error.

Why the old core edit should not be used

Changing client/src/views/stream/notes/update.js directly:

  • is overwritten by EspoCRM upgrades;
  • bypasses the Custom namespace intended for application overrides;
  • can become incompatible when the core stream template changes;
  • makes the customization difficult to package or review.

The Custom item-view mapping keeps the change separate and allows EspoCRM to continue providing the underlying stream behavior.

Common problems

Update notes remain collapsed

Check the exact module path and the Update key’s capitalization, then run Administration → Rebuild and reload the browser.

The Stream panel has no field-change note

Confirm that Stream is enabled for the entity and that the changed field is audited. This customization changes rendering only; it does not create audit notes.

The view fails after an EspoCRM upgrade

Compare the current standard views/stream/notes/update interface with this override. Keep the subclass minimal and avoid copying the core implementation into Custom code.