Skip to content

Automatically update inherited values when the parent entity's value is changed #3217

@sleidig

Description

@sleidig

As a user I want to easily share the phone number of a parent's entity in each child's linked entity in order to avoid double entry and confusion (forgetting to update the number in some of the child records).

Objective

Inherited values with automatic update/synchronization

  1. Entity has a field with "inherited value" (using the "inherited-from-referenced-entity" mode of defaultValue configuration)
  2. Whenever the value (in parent) is changed, the system automatically updates all linked fields, so that all the entities always hold the same value (after showing a confirmation dialog)
  • Currently the user has to actively open the record and update the inheriting field with a click
  • The technical discovery and update could be implemented in a similar way to the status automation
  1. User has the option to manually overwrite the inherited value and disable auto-updates by that.

Possible edge cases:

  • Possibly can’t always update all affected entities, if there are fine-grained, special roles and permissions
  • danger of sync conflicts if large number of inherited values? (we assume this is not very likely, if the rules are sensibly configured)
  • ⚠️ inherited value can have multiple sources (e.g. multiple Recurring Activity records that reference the Child). The button to manually inherit is not clearly defined anymore then ... -> open dialog from all options?

also see Requirements Doc


Implementation approach:

Requirements:

  1. WHEN value of inherited field in parent changes and entity is saved THEN user sees a confirmation dialog to automatically update all entities that inherit that value
  2. WHEN value of inherited field is manually changed in child THEN that record is listed separately (collapsed, not immediately visible) in the confirmation dialog for updates (because probably the manually defined value should not be automatically overwritten)
  3. WHEN the user resets the inherited field to the parent value, it is auto-updating again in the future.

Implementation steps

  1. Research, discuss and decide if the update logic should be added to the AutomatedStatusUpdateConfigService (used for "inherited-from-referenced-entity" mode) or a similar second service should be created (4)
  2. Write unit tests for all possible cases mentioned above (3)
  3. Create or adjust confirmation dialog component (6)
  4. Implement detection logic which entities are affected (4)
  5. Test, refine, review and refactor (5)

Further notes: https://docs.google.com/document/d/1UrqcdOPm28hV7plGoifMkl_FmchHOcArPc6ll5ViTvU/edit?tab=t.0

Sub-issues

Metadata

Metadata

Labels

Projects

Status

Done

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions