Skip to content

Instantly share code, notes, and snippets.

View pozil's full-sized avatar

Philippe Ozil pozil

View GitHub Profile
@pozil
pozil / run-apex.sh
Last active July 19, 2022 14:19
Shell scripts that runs anonymous Apex with Salesforce CLI and filters out command output to only display time stamp and debug messages
#!/bin/bash
# Shell scripts that runs anonymous Apex with Salesforce CLI and filters out command output to only display time stamp and debug messages
# Know limitation: the script doesn't support multiline log messages (it will only display the first line)
# Get Apex file path from parameter or ask for it
filePath=""
if [ "$#" -eq 1 ]; then
filePath="$1"
else
echo "Apex file path:"
@pozil
pozil / Build-WSC-JAR.md
Last active March 1, 2022 13:57
Build JAR files with WSC from WSDL files

This script lets you build JAR files with WSC from Salesforce WSDL files.

  1. Create a new directory and place this shell file in the directory.
  2. Obtain the Enterprise, Partner and Metadata WSDL files from your Salesforce org and place them in the folder.
  3. Run the build-jars.sh script.
  4. Grab the JAR files from the build directory.
@pozil
pozil / README.md
Created July 4, 2022 09:58
Drawing a Sankey Chart with Lightning Web Components and Chartjs

Drawing a Sankey Chart with Chartjs

This Gist explains how to draw a Sankey chart on the Salesforce Platform with Lightning Web Components. We use the Chart.js library and the chartjs-chart-sankey plugin. For the sake of simplicy we start from an existing Salesforce project: LWC Recipes.

  1. Install LWC Recipes and make sure that you can see the Chart.js recipe located in the 3rd Party Libs tab.
  2. Enable Lightning Web Security or you'll get the following error message:

    TypeError: ResizeObserver is not a constructor

  3. Download the latest version of the chartjs-chart-sankey plugin from this CDN link and rename the file to chartJsSankey.js.