Skip to content

Instantly share code, notes, and snippets.

View sankaran1984's full-sized avatar

Sankaran Nepolean sankaran1984

View GitHub Profile
db.matrix_parameter_row__c.find({
"$or": [
{
"NE__Active__c": true,
"Row_Type__c": {
"$in": [
"Tariff",
"Metering",
"Discount"
]
@sankaran1984
sankaran1984 / gist:d06d0fc79b11f12bd4e2b61896c33055
Created February 23, 2017 08:46
Visualforce - Beyond Basics
public class testclass1_23022017 {
/* VF Bindings */
Public String searchStr{get;set;}
Public Map<String, List<Map<String, String>>> results {get;set;}
/* Action Function */
public void startSearch() {
List<List<sObject>> lsResults = [
@sankaran1984
sankaran1984 / gist:dd1b908f41bc0727f81823a2daf58a5c
Created February 23, 2017 08:45
visualforce - Beyond Basics
<apex:page controller="testclass1_23022017">
<apex:sectionHeader title="Global Search Box"/>
<apex:form >
<apex:outputLabel value="Enter you search text here "/>
<apex:inputText value="{!searchStr}"/>
<apex:commandButton value="Go" action="{!startSearch}" rerender="DisplayArea"/>
</apex:form>
@sankaran1984
sankaran1984 / gist:5346073d4048660548d91caf5566687a
Created February 23, 2017 08:26
Visualforce - Beyond Basics
<apex:page standardController="Opportunity" recordSetVar="Opps">
<style>
.ReqHelpText {
display : inline-block;
width : 3px;
background-color : #c00;
}
</style>
@sankaran1984
sankaran1984 / gist:2e7e23ec5c217d0ad32dfacacdad647a
Created February 23, 2017 06:51
visualforce - Beyond Basics
<apex:page standardController="Opportunity">
<style>
.ReqHelpText {
display : inline-block;
width : 3px;
background-color : #c00;
}
</style>
@sankaran1984
sankaran1984 / gist:2bd85fc417291f3d360337b28a0fb0b3
Created February 22, 2017 19:37
visualforce - beyond basics
public class testclass6_22022017 {
public OpportunityWrapper oppWrapObj {get;set;}
public testclass6_22022017() {
oppWrapObj = new OpportunityWrapper(ApexPages.currentPage().getParameters().get('Id'));
}
class OpportunityWrapper {
Public String genericName{get;set;}
@sankaran1984
sankaran1984 / gist:2c785cfc917fa05ede23b3504e450d92
Created February 22, 2017 19:33
Visualforce and beyond basics
<apex:page controller="testclass6_22022017">
<apex:sectionHeader title="Extend the Standard Opportunity Object"/>
<!-- Show Opportunty Standard Fields -->
<apex:sectionHeader subtitle="Standard Fields"/>
<apex:outputPanel layout="block">
<apex:outputLabel value="Name - "/>
<apex:outputText value="{!oppWrapObj.opp.Name}"/>
</apex:outputPanel>
@sankaran1984
sankaran1984 / gist:601bf611bb69d9b694d9b9f2b343fa29
Created February 22, 2017 18:43
Visualforce - Beyond Basics
<apex:page >
<apex:sectionHeader title="Styling based on User Configuration"/>
<!-- Show a text with Color, Configured for ORG -->
<apex:outputText value="My Sample Text"
style="color:{!$Setup.TestSettings__c.Color__c};font-size:{!$Setup.TestSettings__c.Size__c}px;"/>
</apex:page>
@sankaran1984
sankaran1984 / gist:ab8a4f3c190c42a14816a910d8682eb4
Created February 22, 2017 18:18
Visualforce - Beyond basics
<apex:page >
<apex:sectionHeader title="This page never expires in session"/>
<apex:form>
<apex:outputText value="A timer running to send request to server every 5sec"/>
<apex:actionPoller interval="5"/>
</apex:form>
@sankaran1984
sankaran1984 / gist:31fbbafca3a1abad886592a9308153d7
Created February 22, 2017 17:59
Visualforce beyond basics
<apex:page standardController="Opportunity">
<button onclick="top.location.href = '/{!Opportunity.Id}'">
Click here to refresh
</button>
</apex:page>