Thursday, May 14, 2020

SFDX force:source:push returns error: PartnerAccountId.field-meta.xml fullName must end with: __c or __kav or __x or __b or __xo or __e or __p or __mdt

Problem / Issue:

Having just retrieved the Opportunity object into my DX Project, I tried to push the source into a newly created ScratchOrg.

> sfdx force:source:retrieve -m CustomObject:Opportunity -u DevHub
... pulled down the metadata for a bunch of components

> sfdx force:source:push

The push operation gave me the following error:
Error
force-app\main\default\objects\Opportunity\fields\PartnerAccountId.field-meta.xml
fullName must end with: __c or __kav or __x or __b or __xo or __e or __p or __mdt (363:13)

Resolution:

The PartnerAccountId is only visible (on Opportunity and Lead records) when an Admin enables Salesforce Partners or purchases Salesforce Partner Community licenses.

To enable this feature in a ScratchOrg, the following features and settings must be defined in the project-scratch-def.json config file.

{
    "orgName": "myOrg",
    "edition": "Developer",
    "features": ["Communities", "EnablePRM"],
    "settings": {
        "communitiesSettings": {
            "enableNetworksEnabled": true,
            "enableEnablePRM": true
        },
        "lightningExperienceSettings": {
            "enableS1DesktopEnabled": true
        }
    }
}

No comments:

Post a Comment