Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 3.25 KB

README.md

File metadata and controls

57 lines (44 loc) · 3.25 KB

Salesforce Snippets for Salesforce (Apex) Development

Version Installs Ratings


Salesforce Snippets Logo

Code snippets for Salesforce (Apex) for Vs Code editor. Additional useful code snippets not included in the Salesforce Extension Pack and improved syntax of some that are.

Installation

  1. Launch VS Code Quick Open Ctrl-P (Windows, Linux) or Cmd-P (OSX)
  2. paste ext install lcotter.salesforce-snippets and press enter.

or

  1. Search for Salesforce Snippets in the extensions market place and install it.

Supported languages (file extensions)

  • Apex (.cls)

Snippets

To use the snippets type part of a snippet and press Tab or Enter or, press ctrl+Space to activate instellisense.

Apex Snippets

Snippet Description
foreach For-each loop
formap For loop for entries in a map
ifelse if/else statement
ifnull if statement null check
ifnotnull if statement not null check
ter x ? y : z
constructor New constructor
newobj New Object
field New field
method New method
staticmethod New static method
setidsfromrecordlist Set of Ids from List of records
mapfromrecordlist Map from List of records
sobjecttype SObjectType for SObject
describesobjectresult DescribeSObjectResult for SObjectType
sobjectfield SObjectField for SObject Field
describefieldresult DescribeFieldResult for SObject Field
sysdebug Debug Statement
sysassf System.assert(false, message);
sysasseq System.assertEquals(expected, actual);
sysassnull System.assertEquals(null, actual);
sysassnotnull System.assertNotEqual(null, actual);
testmethod Test method