Skip to content

Instantly share code, notes, and snippets.

View pgajek2's full-sized avatar

Piotr Gajek pgajek2

View GitHub Profile
@pgajek2
pgajek2 / flsSharing.cls
Last active March 28, 2026 18:46
FLS + Sharing in Apex SOQL
/**
* Tests covering all FLS, OLS, and Sharing Mode combinations from the SOQL security matrix:
*
* SOQL Keyword | Class Sharing | OLS+FLS | Sharing Mode
* -----------------------|-------------------|---------|-------------
* WITH USER_MODE | with sharing | ✅ | ✅
* WITH USER_MODE | inherited sharing | ✅ | ✅
* WITH USER_MODE | without sharing | ✅ | ✅
* WITH SYSTEM_MODE | with sharing | ❌ | ✅
* WITH SYSTEM_MODE | inherited sharing | ❌ | 🔄
@pgajek2
pgajek2 / .js
Created April 28, 2024 14:15
Dynamic Function in LWC
import { LightningElement } from 'lwc';
export default class DynamicFunctionInvocation extends LightningElement {
handleDynamicInvocation(recordId) {
const prefixToHandler = {
'001': this.handleAccounts,
'003': this.handleContacts,
'006': this.handleOpportunities,
// ...
};
@pgajek2
pgajek2 / BeyondTheCloudCodeChallenge1.js
Last active April 4, 2024 08:38
BeyondTheCloud: Code Challenge 1
// JAVA SCRIPT
// Problem
function build(productA, productB, productC) {
let result = '';
if (productA) {
result += productA;
if (productB) {