5

Going through a trailhead course on Salesforce DX and could use some help understanding this line - "The metadata components within an artifact can only live in one artifact at a time".

Does that mean that for instance two teams working on two different artifacts couldn't add a custom field to the same object? Is there some built-in constraint for this? Thanks for any clarification.

  • 1
    The actual truth is a bit off the documentation, though. For example, you can have a custom object in multiple artifacts, each with a different set of custom fields; this allows you to not have a dependency. Unfortunately, the only way to know for sure is to experiment, because the documentation isn't clear what's allowed and what's not, and what will break in beautifully terrifying ways if you break the rules. – sfdcfox Jun 1 '18 at 12:34
4

There is one detailed answer by Derek. Please have a look, i am pasting some info from there which is relevant to your question.

An 'artifact' is just an abstract concept that seems to be used to refer to both individual components (Apex Classes, Workflow, Validation Rules, SObject fields, Visualforce pages, etc...) as well as a collection of components (say, a Visualforce page, along with its controller extension class, static resources, an SObject field that only it uses, and a permission set).

One or more components create the abstract unit called an Artifact. Any single component can exist, at most, in only one Artifact. App Exchange apps are an example of an Artifact.

Components that are used by multiple Artifacts don't really fit well in the current SFDX model.

For Components that would reside in multiple Artifacts (SObjects, Validation Rules, Fields, etc.. will be common targets for this distinction), we need to put them in a completely separate Artifact. At that point, we start having dependencies between Artifacts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.