Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
displayToast : function (component, event, helper) {
var toast = $A.get("e.force:showToast");
if (toast){
//fire the toast event in Salesforce1
toast.setParams({
"title": "Success!",
"message": "The component loaded successfully."
});
toast.fire();
} else {
<!--Event Definations in event file-->
<aura:event type="APPLICATION">
<aura:attribute name="saccount" type="Account"/> <!Note Attribute carries Pay load-->
</aura:event>
<!--Publish events from edit component-->
<aura:registerEvent name="saveAccount" type="c:saverowEvent" />
<ui:button label="Submit" press="{!c.updateAccount}" class="btn btn-default btn-lg btn-block"/>
<apex:page sidebar="false" showHeader="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<html>
<head>
<style type="text/css">
body {background: white; margin: 20px;}
h2 {margin: 20px 0;}
</style>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
global class MyAccCtrl{
@RemoteAction
global static list<Account > myAccounts() {
return [select id, name, Phone,Website from Account where Phone!=null Order By LastModifiedDate DESC LIMIT 50];
}
}
<apex:page controller="MyAccCtrl" showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0">
<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"/>
<apex:remoteObjects jsNamespace="RemoteObjectModel">
<apex:remoteObjectModel name="Account" jsShorthand="acc" fields="Name,Phone"></apex:remoteObjectModel>
</apex:remoteObjects>
<script>
var app = angular.module("ngApp", []);
<c:Responsive_Calendar URL="id" ObjName="Event" StartDateTimeFieldName="Startdatetime" EndDateTimeFieldName="Enddatetime" Namefield="Subject"/>
public class LinkedInCrtl{
public LinkedInParser lwrapper{get;set;}
public LinkedInCrtl(){
lwrapper=new LinkedInParser();
fetchLinkedInDetails();
}
private void fetchLinkedInDetails(){
public class LinkedInParser{
public String emailAddress{get;set;} //[email protected]
public String id{get;set;} //k4UiLk0S8c
public cls_languages languages{get;set;}
public cls_location location{get;set;}
public Integer numConnections{get;set;} //334
public String pictureUrl{get;set;} //https://media.licdn.com/mpr/mprx/0__HjzfUfekIOzW4-Rh2LzFgge5f3H7HlUWHWUWaIe5uiW742F7MLRG7EWFI7H7d2RdHLzT4dd2Ipd22OUWU4dF7kLWIpe22ecWU492mlHCodX6VPwLomZuVxJdY6Z5206h4yJwp-201P
public cls_publications publications{get;set;}
public cls_skills skills{get;set;}
public class Futureapexcallout{
@future(Callout=true)
public static void apexcallout(string billingstate,string billingcity,Id AccountId){
// Instantiate a new http object
Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
@msrivastav13
msrivastav13 / TriggerLearnerTemplate
Created February 19, 2015 16:24
Trigger Template
trigger AccountTrigger on Account(before insert,after insert,before update,after update,before delete,after delete,after undelete){
if(trigger.isbefore && trigger.isinsert){
system.debug('BEFORE INSERT'+trigger.new);
}
if(trigger.isafter && trigger.isinsert){
system.debug('AFTER INSERT'+trigger.new);
system.debug('AFTER INSERT MAP'+trigger.newmap);
}
if(trigger.isafter && trigger.isupdate){
system.debug('AFTER UPDATE NEW'+trigger.new);