Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Salesforce code snippetsNew to Visual Studio Code? Get it now.
Salesforce code snippets

Salesforce code snippets

Pavan Kodipalli

|
1,018 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Features

This extension has useful code snippets for the following

  • Apex
  • Visualforce
  • Aura Compoennts (componnet, controller, helper,design)
  • Web Components

Apex Code Snippets

Variable declaration

  • vd : primitive variable primitive datatype variable declaration

  • c : custom object or field custom object or field

  • vs : string variaiable declaration variable with default value

  • vgs : variable with get set variable with getter and setter

  • vl : list variable primitive data type list with default initializer

  • vsl : string list variable with 2 default values string list variable with 2 default values

  • vo : sobject variable declaration for new record sobject variable declaration for new record

  • vol : sobject list variable with default initializer sobject list variable with default initializer

SOQL Statements

  • soql : standard soql statement standard soql statement

  • soql_one_rec : soql query to fetch one record to new sobject variable soql query to fetch one record to new sobject variable

  • soql_listvar : soql query to fetch more than one record and assign to list soql query to fetch more than one record and assign to list

for loop

  • for_primitive : for loop to loop through primitive list for loop to loop through primitive list

  • for_inline_soql : for loop to loop though soql records inline for loop to loop though soql records inline

  • for_new_soql : for loop for object list with new variables for loop for object list with new variables

control statements

  • if : if statement

  • ife : if else statement

exceptions

  • tc : try catch with System.debug error flow

Debug statements

  • sdv : system.debug for a variable

  • sds : system.debug for a selected variable

Visualforce Code Snippets

Aura Components Code Snippets

Componnet tags
  • aattrib : Aura lighting attribute tag

  • abutton : aura lightning button

  • aNumber : aura lightnign number input

  • iter : aura iteration loop

Controller, Helper and Design

  • call_apex : call apex class method from controller or helper call apex class method from controller or helper

  • call_apex_full : call apex class method from controller or helper with the excpetion handling call apex class method from controller or helper with the excpetion handling

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft