Skip to content

Instantly share code, notes, and snippets.

View balindersingh's full-sized avatar

Balinder Singh balindersingh

View GitHub Profile
@balindersingh
balindersingh / MyModule.js
Last active December 29, 2019 20:46
Sample module for test coverage article
var _MyModule = {};
// public function
_MyModule.Add = function (a, b) {
// your code here
return parseFloat(a) + parseFloat(b);
};
_MyModule.Subtract = function (a, b) {
// your code here
return parseFloat(a) - parseFloat(b);
};
@balindersingh
balindersingh / azure-pipeline-sample
Last active August 6, 2020 12:42
Sample-pipeline-code
# image: if want to use custom docker image. The recipe in dockerhub
resources:
containers:
- container: mycustomimage
image: balindersingh/salesforce-deploy
# default container
pool:
vmImage: 'windows-latest'
@balindersingh
balindersingh / GoogleSheetToAirtable
Created May 4, 2022 15:32
Create records in Airtable from Google sheets using Google AppScript
function addMenu() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Air Table')
.addItem('Create a dummy record Airtable','createAirtableSingleTestRecord')
.addItem('Push current sheet to Airtable','createAirtableRecordFromCurrentSheet')
.addToUi();
}
const Airtable_API_Key = "<YOUR_AIRTABLE_API_KEY>";
const Airtable_API_Endpoint = "https://api.airtable.com/v0/";
@balindersingh
balindersingh / litePaeParentComponent
Created June 7, 2022 21:28
Call Lite Pae LWC component in Aura component
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<litepae:litePae paymentAccounts='<RecordId>' currencyCode="usd" buttonLabel="Payment" amountLabel="Amount ($):" isAmountReadOnly="true" amountToBeCharged='2550'></litepae:litePae>
</aura:component>
<!--
paymentAccounts - RecordId of litepae__Payment_Account__c
currencyCode - 3 digit currency code
buttonLabel - label for submit button
amountLabel - label for amount
isAmountReadOnly - make amount read only or editable for end user
@balindersingh
balindersingh / LitePaeReadMe.md
Last active June 18, 2022 06:15
2 Salesforce flows with Lite Pae added as component to collect payments

Create 2 sample flows which has Lite Pae components

  • Please find attached zip file which has metadata to be deployed to your org after you install Lite Pae app in your Salesforce org.
  • It has 2 flows, which basically have Lite Pae compoent with some additional steps to collect payment using Salesforce flows.
  • Minimum version of Lite Pae required - v1.3
@balindersingh
balindersingh / cicd-deploy.sh
Created July 20, 2023 18:15
Validate or Deploy using sfdx auth using JWT
#!/bin/bash
# Sample cmd to run in terminal
# Code Sample 1: it will validate to org (-u)
# sh cicd-deploy.sh -u "yourpborg@pboedition.com.sandbox" -ev "your_ev" -ek "your_ek" -ck "your_sf_connected_app_client_id"
USERNAME="";
CHECKONLY="true";
CONSUMER_KEY="";
ENCRYPTION_IV="";
ENCRYPTION_KEY="";
INSTANCE_URL="https://test.salesforce.com";
@balindersingh
balindersingh / JSONParserInvocableAction.cls
Created December 14, 2023 21:32
Parse JSON string in Salesforce FLOW using Invocable Action
/*
* @input (Request object):
* @param: JSON String to Parse ==>
@example:
{
"Charges": [
{
"CardDetail": {
"Brand": "visa",
"ExpMonth": 2,