Skip to content

Instantly share code, notes, and snippets.

View sudhakar6's full-sized avatar
🎯
Focusing

Sudhakar sudhakar6

🎯
Focusing
View GitHub Profile
@sudhakar6
sudhakar6 / Enable "Go to Definition" and "Peek Definition" on VSCode for Salesforce
Last active March 16, 2023 13:44
Enable "Go to Definition" and "Peek Definition" on VSCode for Salesforce
The suggested solutions in this link worked for me: https://github.com/forcedotcom/salesforcedx-vscode/issues/1732
To configure this we need a specific JAVA version , here https://developer.salesforce.com/tools/vscode/en/vscode-desktop/java-setup here we can see which java version Salesforce Apex Language Server currently supports.
Java on mac and hwo to check them is discussed here: https://stackoverflow.com/questions/36766028/see-all-the-java-versions-installed-on-mac
You can use cmmand+ to increase size and font of terminal
https://www.youtube.com/watch?v=iFvXNfFE_IE
To clear : Command+K or clear (When you click command K it completely erases but when you use "clear" it just scriolls up), command+l (it just clears the previous command we used)
To check software version type: sw_vers
To know even more details: system_profiler (it gives you lots of information, that you can't even read
To go to the granualar level of system usage caommand: system_profiler -usage (it gives different commands and it's uage)
To use a specific types which is given by above command: system_profiler -listDataTypes (which gives all the data types)
To find is there any software to update: softwareupdate -l
To monitor network connections: nettop (press q to come out of that window)
To monitor the tcp netowrk connections: nettop -m tcp (it shows all the connections using tcp)
@sudhakar6
sudhakar6 / filenamechange.py
Last active May 9, 2022 07:25
Python script to change the change files names in a directory(Windows, May work for Mac as well but not tested)
import os
path = r'C:\Users\SudhakaraReddy.Chint\Desktop\customMetadata\\'
files = os.listdir(path)
for index, file in enumerate(files):
print(file)
#To remove suffix of the file name, this can be replaced based on the requirement
filern = file.removesuffix('.md-meta.xml')
#To remove last three characters of the file name, this can also be modified.
@sudhakar6
sudhakar6 / namechange.bat
Created May 4, 2022 19:09
Windows batch script to find a string in files names and replace with another string. Ex: file.md-meta.xml to file1.md-meta.xml. It loops through the all files and changes file name
@echo off
setlocal enableDelayedExpansion
for %%F in (*.md-meta.xml) do (
set "name=%%F"
ren "!name!" "!name:.md-meta=1.md-meta!"
)
@sudhakar6
sudhakar6 / SOQL Queries
Last active February 12, 2022 13:43
SOQL Queries
Query duplicate record based on a field:
Field: Account.Email__c
SELECT Email__c, COUNT(Id) FROM Account GROUP BY Email__c HAVING COUNT(Id) > 1 ORDER BY Count(ID) DESC
@sudhakar6
sudhakar6 / FilesToExcludeScriptForVSCode.Txt
Last active January 14, 2022 14:47
Script to exclude files containing, starting or ending with a specific text in the name for VSCode Global Search
Paste the below script in 'files to exclude' box in VSCode global search to avaoid the files containing, starting or ending with the text 'TEST' and it is case sensitive.
*TEST.cls,*Test.cls,Test*,*Test*
Fallow the same approach for 'files to exclude'
command to retrieve componenets from a package:
sfdx force:source:retrieve -n "packageName"
To define metadata of your org:
sfdx force:mdapi:describemetadata -f pathwhereyouwanttosavefile\filename.json
for f in "$@"
do
DEST=""
if [[ $f == *"Screenshot"* ]]
then
DEST=/Users/s.chintapalli/Dropbox/Screenshots
elif [[ $f == *"Screen Recording"* ]]
then
DEST="/Users/s.chintapalli/Desktop/Screen Recordings"
fi
@sudhakar6
sudhakar6 / Sfdc Session ID code
Last active March 16, 2023 13:35
Code to get session and login with session ID
code to get session id:
System.debug('&######## '+ UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));
Login URL: <orgURL>/secur/frontdoor.jsp?sid=<orgSessionID>
@sudhakar6
sudhakar6 / package.xml
Last active October 28, 2020 06:06
package.xml with all metadata types
ActionLinkGroupTemplate,ApexClass,ApexComponent,ApexPage,ApexTrigger,AppMenu,ApprovalProcess,AssignmentRules,
AuraDefinitionBundle,AuthProvider,AutoResponseRules,BrandingSet,CallCenter,Certificate,CleanDataService,Community,
ConnectedApp,ContentAsset,CorsWhitelistOrigin,CustomApplication,CustomApplicationComponent,CustomFeedFilter,
CustomHelpMenuSection,CustomLabels,CustomMetadata,CustomObject,CustomObjectTranslation,CustomPageWebLink,CustomPermission,
CustomSite,CustomTab,Dashboard,DataCategoryGroup,DelegateGroup,Document,DuplicateRule,EclairGeoData,EmailServicesFunction,
EmailTemplate,EscalationRules,ExternalDataSource,ExternalServiceRegistration,FlexiPage,Flow,FlowCategory,FlowDefinition,
GlobalValueSet,GlobalValueSetTranslation,HomePageComponent,HomePageLayout,InstalledPackage,Layout,Letterhead,LightningBolt,
LightningComponentBundle,LightningExperienceTheme,MatchingRules,NamedCredential,NetworkBranding,PathAssistant,PermissionSet,
PlatformCachePartition,PostTemplate,Profile,ProfileSessionSetting,Queue,Qu