Skip to content

Instantly share code, notes, and snippets.

View saicharanreddyk's full-sized avatar

Saicharan Reddy K saicharanreddyk

View GitHub Profile
@saicharanreddyk
saicharanreddyk / sfdx commands list
Last active January 25, 2024 00:16
sfdx commands list
C:\Users\Saicharan Reddy K>sfdx force:doc:commands:list
WARNING: The command "DocListCommand" has been deprecated and will be removed in v49.0 or later. Use "sfdx commands" instead.
=== Commands
force:alias:list # list username aliases for the Salesforce CLI
force:alias:set # set username aliases for the Salesforce CLI
force:analytics:template:create # add an Analytics template to your workspace
force:apex:class:create # create an Apex class
force:apex:execute # execute anonymous Apex code
force:apex:log:get # fetch the last debug log
force:apex:log:list # list debug logs
@saicharanreddyk
saicharanreddyk / SalesForceBackup.py
Created September 5, 2018 04:28 — forked from mattkatz/SalesForceBackup.py
Simple python Script to backup a salesforce instance to csv files
from simple_salesforce import Salesforce, SalesforceMalformedRequest
from argparse import ArgumentParser
from csv import DictWriter
from datetime import date
from pathlib import Path
production_instance = 'yourinstance.salesforce.com'
parser = ArgumentParser(description="Backs up all Salesforce objects to csv files")
parser.add_argument("username", help="User to authenticate as. Should be part of an 'integration_user' profile or some profile with no ip range restriction")
Book mark this below piece of code in your browser and just click on it once you logged into salesforce Org. 
javascript: alert('Copied to Clipboard SessionId --> ' +document.cookie.match(/(^|;\s*)sid=(.+?);/)[2]); var copyFrom = document.createElement("textarea"); copyFrom.textContent = document.cookie.match(/(^|;\s*)sid=(.+?);/)[2]; var body = document.getElementsByTagName('body')[0]; body.appendChild(copyFrom); copyFrom.select(); document.execCommand('copy'); body.removeChild(copyFrom);
Execute below piece of code in console to get the Current User Session Id.
document.cookie.match(/(^|;\s*)sid=(.+?);/)[2];
ssh-keygen -t rsa -b 4096 -C "saicharan.reddy70@gmail.com"
clip < .ssh/id_rsa.pub
ssh -T git@github.com
@saicharanreddyk
saicharanreddyk / How to read input values based on ids.txt
Created February 5, 2020 10:11
Lightning - How to read input values based on ids
If we want read the input values by using ids we need to use
component.find("Id of the element").get("v.value");
If we want to set any value based on id we need to use below code
component.find("Id of the element").set("v.value");
Component:
*************************************************************************
<aura:component >
<lightning:card iconName="standard:contact">
<aura:set attribute="actions">
@saicharanreddyk
saicharanreddyk / How to read input values using attributes
Created February 5, 2020 10:21
Lightning - How to read input values using attributes
In order to read values entered in input elements we can use <aura:attribute>.
To get the values from the input elements we need to use below code
component.get("v.Name Of the Attribute");
And we need to provide the value attribute in lightning input
<lightning:input label="Enter Amount" type="number" required="true" value="{!v.Name Of the Attribute}"/>
To set the value to the component using the attribute we need to use the following code
component.set("v.Name Of the Attribute",Value which needs to be assigned);
@saicharanreddyk
saicharanreddyk / How to identify which button was clicked using event
Created February 5, 2020 10:29
Lightning - How to identify which button was clicked using event
In order to find which button was clicked we can use event methods.
In the below example I used three button.
With below piece of code we can find which button was clicked. On click of a button a controller method will be called
inside that methos we can use event methods to capture the information.
var source = event.getSource(); // From which element/source event was fired ?
var id = evt.getLocalId(); // Id of the element from which event was fired
var name = evt.get("v.name"); // Name of the element from which event fired
@saicharanreddyk
saicharanreddyk / Read the values based on ids and set the values based on attributes
Created February 5, 2020 11:24
Lightning - Read the values based on ids and set the values based on attributes
I have got this strange doubt when we can read the values based on ids what is the use of <aura:attribute>
For displaying the data we can use output text. In this case we are reading and assigning the values in script i.e. controller.
In order to display values in markup i.e. component we need attributes
Component
************************************************************************************************
<aura:component >
<aura:attribute name="FirstName" type="String" />
<aura:attribute name="LastName" type="String" />
<aura:attribute name="DateOfBirth" type="Date" />
@saicharanreddyk
saicharanreddyk / aura:if
Created February 5, 2020 11:41
Lightning - Aura:if
aura:if evaluates the isTrue expression on the server and instantiates components in either its body or else attribute.
Only one branch is created and rendered. Switching condition unrenders and destroys the current branch and generates the other
<aura:if isTrue="{!v.truthy}">
If true process this piece of code
<aura:set attribute="else">
If false process this piece of code
</aura:set>
</aura:if>