Skip to content

Instantly share code, notes, and snippets.

input[type=checkbox] {
opacity: 1;
float:left;
}
input[type=checkbox] {
margin: 0 0 0 20px;
position: relative;
cursor: pointer;
font-size: 16px;
@swapnilshrikhande
swapnilshrikhande / SplitContactName.cls
Created December 18, 2016 08:36
Split Contact Name Into First, Middle and Last name components.
String s = 'FirstName MiddleName LastName AnotherName';
String[] arrayS = s.split(' ', 3);
System.debug ( 'First :- '+ getFirstName(arrayS) );
System.debug ('Middle :-'+ getMiddleName(arrayS) );
System.debug ('Last Name :-'+ getLastName(arrayS) );
s = 'FirstName MiddleName LastName';
arrayS = s.split(' ', 3);
System.debug ( 'First :- '+ getFirstName(arrayS) );
@swapnilshrikhande
swapnilshrikhande / event-bubble.html
Last active December 20, 2016 08:39
Event Bubble Demo
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="./jquery-1.11.3.js"></script>
</head>
<style type="text/css">
.target{
border: 5px groove black;
padding : 50px;
public interface Organism {
}
public interface Part {
List<Limb>
}
public interface Limb {
//can be composed of Cells
Requirement Analysis:
Proposed Solution:
Technical Solution: classes
Estimation:
Dev:
Test Methods
Dev Unit Test
Clarification:
@RemoteAction
public static map<String,map<String,String>> getValidationRule() {
map<String,map<String,String>> mapObjectValidationRule = new map<String,map<String,String>>();
// get list of the validation rules associated with the object
String domainUrl = URL.getSalesforceBaseUrl().toExternalForm();
HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
req.setHeader('Content-Type', 'application/json');
req.setEndpoint(domainUrl+'/services/data/v36.0/tooling/query/?q=Select%20id%2CValidationName%2CActive%2CEntityDefinitionId%20From%20ValidationRule');
@swapnilshrikhande
swapnilshrikhande / ddMMyyyy formated formula
Created March 24, 2017 06:41
sf ddMMyyyyformatedformula
IF( DAY(Invoice_Date__c)<10,'0','' )
& TEXT(DAY(Invoice_Date__c))
&'/'&
IF( MONTH(Invoice_Date__c)<10,'0','' )
& TEXT(MONTH(Invoice_Date__c))
&'/'&
TEXT(YEAR(Invoice_Date__c))
@swapnilshrikhande
swapnilshrikhande / FormattedLongText.component
Last active March 31, 2017 13:03
Formatted Long Text Area
<apex:component controller="FormattedLongTextController" >
<apex:attribute name="inputValue" assignTo="{!longText}" description="input long text field" type="String" required="true"/>
<apex:outputText escape="false" value="{!formattedLongText}" />
</apex:component>
<apex:page >
<script src="{!URLFOR($Resource.recaptcha_wc, 'webcomponentsjs/webcomponents-lite.min.js')}"></script>
<link rel="import" href="{!URLFOR($Resource.recaptcha_wc, 're-captcha/re-captcha.html')}"/>
<re-captcha sitekey="6LdAph4UAAAAAFMj2Qk6huZS27MppjnrkYlEeYNE"></re-captcha>
</apex:page>
@swapnilshrikhande
swapnilshrikhande / getWebdriverMethod.java
Last active May 31, 2017 05:27
Selenium Support Multiple Browsers
/*Embed this method in your test class*/
private WebDriver getWebdriver(String browser){
WebDriver driver = null;
// If the browser is Firefox, then do this
if(browser.equalsIgnoreCase("firefox")) {
System.setProperty("webdriver.gecko.driver", "drivers\\geckodriver.exe");
driver = new FirefoxDriver();
// If browser is IE, then do this
} else if (browser.equalsIgnoreCase("chrome")){
System.setProperty("webdriver.chrome.driver", "drivers\\chromedriver.exe");