This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by sonal on 2024-01-01. | |
*/ | |
/** | |
* Validate unique constraints on Salesforce objects. It accepts a list of records and checks if there are | |
* any duplicate records based on the fields specified in the constructor. | |
* The SObjectType represents the type of Salesforce object that the class will work with, and the list of | |
* fields represents the fields that should be unique. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pricing | |
There are two pricing options here. Fixed Price or Percent of Total. | |
Fixed Price subscriptions are products that have just that, a fixed price. This fixed price can either be a one specific price for the product -or- be obtained from a table of prices or “rate card” as some folks call it. The rate card is a set of prices for a given product, divided up by a set of tiering criteria such as quantity range. | |
Percent of Total subscriptions are products where the price is calculated based on a specific percentage of the total cost of the quote. Common products that are percent of total are warranty products and maintenance products. | |
Perhaps you have a warranty covering products purchased and the cost of which is 10% of the products that are being purchased. | |
Or maybe you are a SaaS company and sell perpetual licenses to your software. You might have a yearly maintenance fee that is priced to be 20% of the perpetual license purchase price. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@wire(getRecordCreateDefaults, {objectApiName: '$objectApiName', recordTypeId : '$recordTypeId'}) | |
recordCreateDefaults({ data, error }) { | |
if (data) { | |
const recordInput = generateRecordInputForCreate( | |
data.record, | |
data.objectInfos[this.objectApiName] | |
); | |
console.log(recordInput); | |
this.recordUi = data.layout; | |
this.loading = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Boolean isChanged(SObject aObj, Schema.SObjectField aField) { | |
return Trigger.isInsert || | |
aObj.get(String.valueOf(aField)) != Trigger.oldMap.get(aObj.Id).get(String.valueOf(aField)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void sendEmail(Map<Id, Order> orderMap) { | |
List<ContentDocumentLink> contentDocumentLinks = [ | |
SELECT Id, ContentDocumentId, LinkedEntityId | |
FROM ContentDocumentLink | |
WHERE LinkedEntityId IN :orderMap.keySet() | |
]; | |
Map<Id, List<ContentDocumentLink>> contentDocumentLinksByOrderId = new Map<Id, List<ContentDocumentLink>>(); | |
Set<Id> contentDocumentIds = new Set<Id>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MetadataApiService.MetadataPort service = createService(); | |
MetadataApiService.CustomField customField = (MetadataApiService.CustomField) service.readMetadata('CustomField', new String[]{ | |
'Account.Demo__c' | |
}).getRecords()[0]; | |
MetadataApiService.GlobalValueSet globalValueSet = (MetadataApiService.GlobalValueSet) service.readMetadata('GlobalValueSet', | |
new List<String>{ | |
customField.valueSet.valueSetName | |
}).getRecords()[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import re | |
from pathlib import Path | |
def listfiles(folder): | |
for root, folders, files in os.walk(folder): | |
for filename in folders + files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################# | |
## SETUP DEMO ## | |
############################################################################# | |
cd /Users/first.last/Documents/workspace/cli-demo-repo | |
CONSUMER_KEY="xxxx" | |
USERNAME="xxxx" | |
INSTANCE_URL="https://login.salesforce.com/" | |
KEY="../cli-demo/server.key" | |
rm -rf "/Users/first.last/Documents/workspace/cli-demo-repo/output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo spctl --master-disable | |
https://github.com/ohmyzsh/ohmyzsh | |
How to Install Zsh/ zsh-autosuggestions/ oh-my-zsh in Linux | |
https://varunmanik1.medium.com/how-to-install-zsh-zsh-autosuggestions-oh-my-zsh-in-linux-65fa01cc038d | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL:https://sethrobertson.github.io/GitFixUm/fixup.html | |
Checkout evHeroHeader.html file from "feature/events/events-record-list" branch to your working branch: | |
git checkout feature/events/events-record-list force-app/events/main/default/lwc/evHeroHeader/evHeroHeader.html | |
Pull all the files from master branch to your working branch: | |
git pull origin master | |
Reset a branch |
NewerOlder