Skip to content

Instantly share code, notes, and snippets.

@davescruggs
davescruggs / sfdx_tips.md
Last active February 5, 2018 01:27
Tips for using the Salesforce DX CLI

Getting metadata into an org

I've had more luck with "open directories" than zip files. Create a directory (src/mdout/etc.), put the package.xml file in the directory at the top level, and create subfolders if needed for "objects", "permissionsets", "classes", etc. Make sure the package.xml is formatted correctly (no mismatches, no extra spaces). There are package.xml examples here.

sfdx force:mdapi:deploy -d -w 3 -u

Getting metadata out of an org

My easiest option right now is to use the package.xml file to pick and choose what files I pull out. Using a temporary package is nice, and finds dependencies, but I find that I have more flexibility with packages

sfdx force:mdapi:retrieve -r -w 3 -k

/package.xml -u

Keybase proof

I hereby claim:

  • I am davescruggs on github.
  • I am davescruggs (https://keybase.io/davescruggs) on keybase.
  • I have a public key ASBTSJ6jrjv4gTevDrN_IgCNCiQlFk7k2emXpsh_HVqkbQo

To claim this, I am signing this object:

@davescruggs
davescruggs / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1AppScaffold.html">
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1PageContainer.html">
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationStageLeft.html">
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationNotifications.html">
<link rel="import" href="../../salesforce/s1-elements/s1AnchorLightDefault.html">
<link rel="import" href="../../salesforce/s1-elements/s1ListWithLabels.html">
<link rel="import" href="../../salesforce/s1-elements/s1AnchorDark.html">
<link rel="import" href="../../salesforce/s1-elements/s1IndicatorDotsLightBackground.html">
<link rel="import" href="../../salesforce/s1-elements/s1ButtonGroups.html">
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1DetailView.html">
@davescruggs
davescruggs / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../../salesforce/mobile-ui-elements/elements/force-ui-app/force-ui-app.html">
<link rel="import" href="../../salesforce/mobile-ui-elements/elements/force-ui-list/force-ui-list.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
#!/usr/bin/python
import cgi
import requests
import json
from simple_salesforce import Salesforce
#login here:
#https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py
@RestResource(urlMapping='/WarehouseREST/*')
global with sharing class WarehouseREST {
global WarehouseREST() {}
}