Layout Assignments

@flxbl-io/sfp project layout-assignments

Migration helper for projects splitting object metadata across object-owning and UI packages. Seeds the mutators/layout-assignments.yml consumed at deploy time when applyLayoutAssignments is enabled.

  • @flxbl-io/sfp project layout-assignments extract

@flxbl-io/sfp project layout-assignments extract

Scans *.object-meta.xml files in a source package and writes every strippable actionOverride (Flexipage, Visualforce, LightningComponent), every object-wide <compactLayoutAssignment>, and every per-recordType <compactLayoutAssignment> into mutators/layout-assignments.yml under a target package. The target package becomes the source of truth; pair this with the ignoreLayoutAssignments descriptor flag on the source package and applyLayoutAssignments on the target package to decouple the dependency between the two.

USAGE
  $ @flxbl-io/sfp project layout-assignments extract -s <value> -t <value> [--json] [--strip] [--force]
    [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -s, --source-package=<value>  (required) Path of the package whose object-meta.xml files are the starting point
                                (the dependency magnet)
  -t, --target-package=<value>  (required) Path of the package that will own the generated layout-assignments.yml
                                (typically the UI package)
      --strip                   Also remove the extracted entries from the source package's object-meta.xml files.
                                Use this as a one-shot migration; routine stripping should happen at build time via
                                the `ignoreLayoutAssignments` descriptor flag.
      --force                   Overwrite the target `mutators/layout-assignments.yml` if it already exists.
                                Without this flag, the command fails when the target file is present so
                                hand-curated entries aren't silently lost on re-run.
      --loglevel=<option>       [default: info] logging level for this command invocation
                                <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Extract layout assignments from an object package into a YAML file in a UI package

EXAMPLES
  $ sfp project layout-assignments extract --source-package src/core-crm --target-package src/ui-crm

  $ sfp project layout-assignments extract --source-package src/core-crm --target-package src/ui-crm --strip

  $ sfp project layout-assignments extract --source-package src/core-crm --target-package src/ui-crm --force
circle-info

After the YAML exists, it is the source of truth. Edit it directly rather than re-running this command. Subsequent stripping should happen at build time via ignoreLayoutAssignments, not via --strip.

Last updated

Was this helpful?