How to Fix Salesforce Deployment Errors: source:push “You may not modify the permission Access Tracer for External Data Sources while editing a Standard Profile”

There are some permissions that are not applicable to a scratch org and this is one of those weird ones. Pushing the standard Admin profile to my scratch org I encountered this error.

You may not modify the permission Access Tracer for External Data Sources while editing a Standard Profile.

To fix this you need to edit and remove this specific profile permission. So far I cannot find any documentation about this TraceXdsQueries permission and what it actually does.

    <userPermissions>
        <enabled>true</enabled>
        <name>TraceXdsQueries</name>
    </userPermissions>

How To Enable SObject Intellisense in VSCode for Salesforce DX

Quick Tip.

Salesforce DX already comes with Intellisense for Apex classes and the different primitive types. Eg. Strings

For SObjects it’s a per-project setting you need to enable once you have your project created. Open the Command Palette and choose SFDX: Refresh SObject Definitions

What the command does under the hood is it will create a class definition of the SObject and store them under the .sfdx folder/tools folder. These don’t get committed to version control as the .sfdx folder is by default ignored.

Each class has properties that allows the Intellisense to work.

Once enabled you are good to go.

If you want more tips and information on Salesforce DX checkout my youtube playlist where I cover them in detail.

Fix for flowruntime:lookup Error With Salesforce Flows

If you recently used the custom lookup component while working on Salesforce Flows and get this error.

We can’t display component ‘flowruntime:lookup’, because it isn’t supported in Classic runtime. 

Chances are you still are on Classic. The component only works on Lightning. An easy fix is to enable the Lightning runtime in Flows.

  1. From Setup, enter Process Automation Settings in the Quick Find box, then select Process Automation Settings.
  2. Select Enable Lightning runtime for Flows.
  3. Save your changes.

How to Clean Up The List of Orgs on force:org:list on Salesforce DX

If you run the cli command sfdx force:org:list and see a bunch of old orgs you recently authorized or scratch orgs that you no longer use.

You can easily clean them up by logging off from the org.

sfdx force:auth:logout -u <alias>

You get this confirmation screen and important reminder if you want to reuse your scratch org you must know the pasword before logging out.

If you don’t need the scratch org you can delete them with the command below.

sfdx force:org:delete -u <alias>

Enable Auto Push or Auto Deploy With Salesforce DX on VSCode

The title says it all if you have been developing before on Force.com IDE/ Mavenmate/IntelliJ and started using Salesforce DX. One that gets pretty tedious fast is manually pushing your code to your scratch org or deploying to your non-tracked org(DE/Sandbox).

To enable auto push/deploy simply edit the .vscode/settings.json. This folder can be hidden on Windows or Mac. On a Mac open the Finder and hit CMD+Shift dot(.) to display hidden files.

Add the following settings and set it to true.

"salesforcedx-vscode-core.push-or-deploy-on-save.enabled": true

My settings.json looks like below.

Another method to do this same steps is to go to the Code menu and choose Preferences then Settings.

Next click on Workspace tab then search for Salesforce

Under Salesforce Feature Previews(3rd one), tick the box under Salesforcedx-vscode-core › Push-or-deploy-on-save: Enabled

This is particularly useful specially for cloned repository where the .vscode folder is not part of the repository.

Don’t forget to update the .gitignore file if you are using version control and add the .vscode folder.

Happy coding!