This file contains hidden or 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
| <script type="text/javascript" runat="server"> | |
| // src: https://gist.github.com/wvpv/19777e1167d6ac91e2e8 | |
| Platform.Load("core", "1"); | |
| var debug = true; | |
| var request = {}; | |
| SetVar("method", Request.Method) |
This file contains hidden or 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
| /** | |
| * Inspired by the JWT repo by Salesforce Identity | |
| * https://github.com/salesforceidentity/jwt/ | |
| * | |
| * Inspired by the JWT repo by Auth0 | |
| * https://github.com/auth0/java-jwt | |
| * | |
| * Learn more about JWT at https://jwt.io | |
| */ | |
| public inherited sharing class JWT { |
This file contains hidden or 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
| <apex:component controller="ApprovalRequestCommentsController" access="global"> | |
| <apex:attribute name="relatedToId" assignTo="{!targetObjectId}" type="String" description="ID of the record whose last approval comments to retrieve"/> | |
| <apex:outputText value="{!comments}"/> | |
| </apex:component> |
This file contains hidden or 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
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "SFDX: Deploy Current File", | |
| "type": "shell", | |
| "command": "sfdx", | |
| "args": [ | |
| "force:source:deploy", | |
| "--sourcepath", |
This file contains hidden or 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
| protected override void afterInsert() { | |
| boolean isSuccessfulRun = false; | |
| for(Integer i=0; i < Trigger.new.size() && isSuccessful == false; i++){ | |
| isSuccessfulRun |= (((DL__c)Trigger.new.get(i)).Status__c == 'Completed'); | |
| } | |
| if(isSuccessfulRun){ | |
| //Kick off batch jobs | |
| Database.executeBatch(new MyNotSoFirstBatchJob(),50); | |
| } |
This file contains hidden or 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
| /** | |
| * Sleep at least a second | |
| * | |
| * Found at: http://boards.developerforce.com/t5/Apex-Code-Development/Best-way-to-delay-until-time-changes-in-a-test/td-p/389619 | |
| * | |
| */ | |
| public static void waitAtLeastASecond() { | |
| Integer msPerS = 1000; | |
| Datetime start = Datetime.now(); | |
| Datetime current = Datetime.now(); |
This file contains hidden or 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
| if ( | |
| and ( | |
| YEAR(Date_Start__c) == YEAR(TODAY()), | |
| IF( | |
| CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7) > 52, | |
| 52, | |
| CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7) | |
| ) == | |
| IF( |
This file contains hidden or 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
| endpoint := instanceUrl + "/services/data/v39.0/tooling/query?q=" | |
| query := "SELECT ApexClassOrTriggerId, ApexClassorTrigger.Name, Coverage FROM ApexCodeCoverageAggregate" | |
| http://forceastute.alexislam.com/2016/09/code-coverage-best-practices.html |
This file contains hidden or 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
| enable Windows Subsystem for Linux submodule then restart | |
| install the following apps: wsltty | |
| install inside wsl the following packages: fonts-powerline, bash-it | |
| install the following node version manager: n | |
| https://salesforce.stackexchange.com/questions/217035/auth-not-working-with-dx-and-windows-subsystem-for-linux-wsl/217104#217104 | |
| https://github.com/wadewegner/salesforce-cli-bash-completion | |
| add firewall rule to enable npm to grab package (in Admin CMD prompt): | |
| install windows version of sfdx | |
| reload the wsl shell. |
This file contains hidden or 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
| global class PrepareMySandbox implements SandboxPostCopy { | |
| global void runApexClass(SandboxContext context) { | |
| System.debug('Org ID: ' + context.organizationId()); | |
| System.debug('Sandbox ID: ' + context.sandboxId()); | |
| System.debug('Sandbox Name: ' + context.sandboxName()); | |
| // Insert logic here to prepare the sandbox for use. | |
| } | |
| } |
NewerOlder