# 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`](/flxbl/sfp/building-artifacts/configuring-installation-behaviour-of-a-package/layout-assignments.md) 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`](/flxbl/sfp/building-artifacts/configuring-installation-behaviour-of-a-package/layout-assignments.md) descriptor flag on the source package and [`applyLayoutAssignments`](/flxbl/sfp/building-artifacts/configuring-installation-behaviour-of-a-package/layout-assignments.md) 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
```

{% hint style="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`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/cli-reference-v50-and-below/utilities/layout-assignments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
