Skip to content

Instantly share code, notes, and snippets.

@amtrack
Last active April 6, 2019 15:49
Show Gist options
  • Save amtrack/b360f63e0cad1cf58f997bde9e00a6ac to your computer and use it in GitHub Desktop.
Save amtrack/b360f63e0cad1cf58f997bde9e00a6ac to your computer and use it in GitHub Desktop.
sfdx-browserforce-plugin-demo

sfdx-browserforce-plugin-demo

clone and install

git clone https://github.com/amtrack/sfdx-browserforce-plugin-demo.git
cd sfdx-browserforce-plugin-demo
npm install

create a scratch org

sfdx force:org:create -f config/project-scratch-def.json -a browserforce-demo

try to push the source (it fails because customer portal is not enabled)

$ sfdx force:source:push -u browserforce-demo
PROJECT PATH                                                    ERROR
──────────────────────────────────────────────────────────────  ──────────────────────────────────────────────
force-app/main/default/portals/Customer Portal.portal-meta.xml  Not available for deploy for this organization
ERROR running force:source:push:  Push failed.

lets install sfdx-browserforce-plugin and activate the customer portal using browser automation

npm install --save-dev sfdx-browserforce-plugin
echo -e "{\n  \"settings\": {\n    \"customerPortal\": { \"enabled\": true }\n  }\n}" > config/browserforce-shape-def.json
BROWSER_DEBUG=true npx sfdx-browserforce-plugin browserforce:apply -f config/browserforce-shape-def.json -u browserforce-demo

and push the source again (force push because the "Customer Portal" has been created by default)

sfdx force:source:push -u browserforce-demo -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment