Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
public class LinkedInCrtl{
public LinkedInParser lwrapper{get;set;}
public LinkedInCrtl(){
lwrapper=new LinkedInParser();
fetchLinkedInDetails();
}
private void fetchLinkedInDetails(){
<c:Responsive_Calendar URL="id" ObjName="Event" StartDateTimeFieldName="Startdatetime" EndDateTimeFieldName="Enddatetime" Namefield="Subject"/>
<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", []);
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 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>
<!--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"/>
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 {
hidenewBtn:function(component,event) {
var toggleBtn= component.find("Newbtn");
$A.util.removeClass(toggleBtn,'btn btn-primary btn-lg btn-block');
$A.util.addClass(toggleBtn,'toggle');
}
//CSS file
/*toggleCss.css*/
.THIS .toggle {
<aura:attribute name="messages" type="Aura.Component[]" access="GLOBAL"/>
<div aura:id="messages">
{!v.messages}
</div>
//Script for Error handling
else if (state === "ERROR") {
var errors = response.getError();
@msrivastav13
msrivastav13 / CurrencyDataSourceConnection
Created August 16, 2015 03:39
Extends the DataSource.Connection class to enable Salesforce to sync the external system’s metadata schema and to handle queries and searches of the external data.
/**
* Extends the DataSource.Connection class to enable
* Salesforce to sync the external system’s metadata schema
* and to handle queries and searches of the external data.
**/
global class CurrencyDataSourceConnection extends DataSource.Connection {
private DataSource.ConnectionParams connectionInfo;
/**