Skip to content

Instantly share code, notes, and snippets.

Setting up local Kafka environment

We are going to set up the following environment:

Kafka - Replicating Organisations

1. Configure Salesforce Connected App

1.1 Create a scratch org

Monitoring Salesforce Metrics with Prometheus

Run a docker container

$ docker run -it --rm -v "${PWD}:/home/sfdx" vadimrudkov/sfdx

Clone the repository

$ git clone git@github.com:ozean12/sfdx-prometheus.git

$ cd sfdx-prometheus

Creating an Unlocked Package

run sfdx docker container

$ cd /path/to/sfdx/projects
$ docker pull vadimrudkov/sfdx
$ docker run -it --rm -v "${PWD}:/home/sfdx" vadimrudkov/sfdx

create a new project

Running terraform inside docker container

Here we are going to create a simplest AWS ec2 instance running terraform in a docker container.

Create terraform.vars file

aws_access_key = "ACCESS_KEY"
aws_secret_key = "SECRENT_KEY"
@v-rudkov
v-rudkov / README.md
Last active January 26, 2021 08:33
Unlocked packages with dependencies

Unlocked Packages with Dependencies

The goal of this tutorial is to build a hierarchy of Salesforce unlocked packages:

    D
    |
    B  C
     \/
      A
@v-rudkov
v-rudkov / getopts_example.sh
Created June 21, 2020 19:43
Example of parsing command line options with getopts
#!/bin/bash
usage="usage: $(basename "$0") [-h | --help] --saga=<name> --event=<name> --source=<name> --target=<name>
where:
-h, --help show this help text
-saga Saga name, e.g. 'Onboarding' (creates a platform event Onboarding__e)
-event Event type name, e.g. 'NewLead'
-source The Apex type to convert from, e.g. LeadService.NewLeadResult
-target The Apex type to convert to, e.g. RestCalloutService.RestCallout"
@v-rudkov
v-rudkov / README.md
Last active November 4, 2020 10:26
Investigating history tables

Investigating history tables

Scenario 1

Recently I was tasked with figuring out how many opportunities changed the stage from, say, Stage1 to Stage2 during the last month. First, let's walk through OpportunityHistory and retrieve all the changes that we are interested in:

$ sfdx force:data:soql:query -u pro -r csv -q \
"select Id, OpportunityId, CreatedDate, StageName
from OpportunityHistory
@v-rudkov
v-rudkov / __readme.md
Last active January 29, 2020 14:50
PlantUML templates for most used diagrams
@v-rudkov
v-rudkov / FirstStep.page
Created June 25, 2019 13:57
apex:outputLink openning a Visualforce page both in Salesforce Classic and Service Console
<apex:page>
<h1>First Step</h1>
<apex:pageBlock>
<apex:outputLink value="#" onclick="nextStep();">Next Step</apex:outputLink>
</apex:pageBlock>
<apex:includeScript value="/support/console/45.0/integration.js"/>
<script type="text/javascript">
function nextStep(){
if(sforce.console.isInConsole()){
@v-rudkov
v-rudkov / __readme.md
Last active November 25, 2019 22:40
SFDX: Hello World Unlocked Package

Hello World Unlocked Package

First, let's create a new project and a source scratch org:

$ sfdx force:project:create -n hello_world
$ cd hello_world
$ sfdx force:org:create -f config/project-scratch-def.json -a hello_world