Skip to content

Instantly share code, notes, and snippets.

View yasarshaikh's full-sized avatar
🦅

Yasar Shaikh yasarshaikh

🦅
View GitHub Profile
@yasarshaikh
yasarshaikh / Lead_csvReader.csv
Last active March 22, 2019 12:22
Read CSV file and upload data to the system without Saving the CSV
FirstName LastName Company
test1 1test 1comp1
test2 2test 2comp2
test3 3test 3comp3
@yasarshaikh
yasarshaikh / CsvReader.apxc
Created February 26, 2019 11:24
CSV Reader in Apex
public class CsvReader {
public static void readCsv(String fName){
if(fname != NULL){
try{
StaticResource sr = [select id, body from StaticResource where name=: fName];
Lead lobj;
List<Lead> lLead = new List<lead>();
if(sr.body != NULL){
String sCSV = sr.body.toString();
@yasarshaikh
yasarshaikh / ComparableDemo.apxc
Created January 24, 2019 13:04
Custom Sort - Apex
/**************************************************************
Class : ComparableDemo
Purpose: To sort by custom field/variable in Wrapper class, in following case- CreatedDate
Example: //Sample Apex code be executed in Anonymous window
List<ComparableDemo> lCD = new List<ComparableDemo>();
List<Account> lAcct = [select id, createdDate from Account order by lastModifiedDate desc];
for(Account a: lAcct)
{
lCD.add(new ComparableDemo(a));
}
/*****************************************
* This file is a node js file. Following are the steps:
* 1. We need to install node js & npm
* 2. We need to install soap module -
* npm install soap
* 3. We need to import wsdl from Salesforce org.
SF Org-> Setup-> Api->Enterprise/partner wsdl->Generate
* 4. We need to import that in same directory of node file.
* 5. This program execution gets easy with VS Code editor
* Ref: https://blog.enree.co/2013/11/nodejs-salesforce-soap-ws-how-to.html
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<aura:attribute name="boat" type="Boat__c" access="public"/>
<!-- <aura:attribute name="BoatReview" type="Object" access="private"/> -->
<aura:attribute name="boatReview" type="BoatReview__c" access="private"/>
<aura:attribute name="newBoatReview" type="Object" />
<aura:attribute name="recordError" type="String" access="private"/>
<aura:registerEvent name="BoatReviewAdded" type="c:BoatReviewAdded" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
@yasarshaikh
yasarshaikh / SalesOperations.json
Created September 11, 2017 13:24
JSON - Sales Operations dashboard || Lightning Rollout Specialist challenge #7
HTTP/1.1 200 OK
Date: Mon, 11 Sep 2017 13:19:09 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
Public-Key-Pins-Report-Only: pin-sha256="9n0izTnSRF+W4W4JTq51avSXkWhQB8duS2bxVLfzXsY="; max-age=86400; report-uri="https://calm-dawn-26291.herokuapp.com/hpkp-report/00D7F000001v17g";
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: referrer origin-when-cross-origin; upgrade-insecure-requests
Set-Cookie: BrowserId=5gmgnsJsSHmpuKWSZDgkyQ;Path=/;Domain=.salesforce.com;Expires=Fri, 10-Nov-2017 13:19:09 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Sforce-Limit-Info: api-usage=24/15000