This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="true" sidebar="true" docType="html-5.0" standardStylesheets="false"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$.ajax('/services/data/v30.0/tooling/query/?q=SELECT PercentCovered FROM ApexOrgWideCoverage', | |
{ | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader('Authorization', 'Bearer {!$Api.Session_ID}'); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class LinkedInRegHandler implements Auth.RegistrationHandler{ | |
//This method is called when the user log-in using social single sign-on credentials. | |
//This method will return the user details, either you can create new user | |
//or return the existing user if the match is found | |
global User createUser(Id portalId, Auth.UserData data){ | |
if(data.email.contains('@gmail.com')){ | |
User u = [Select id,email,isActive from user where email =: data.email and isActive = true Limit 1]; | |
return u; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class userGroupRemoval implements Database.Batchable<sObject> { | |
String query = 'Select Id from user where isActive = true'; | |
global Database.QueryLocator start(Database.BatchableContext BC) { | |
return Database.getQueryLocator(query); | |
} | |
global void execute(Database.BatchableContext BC, List<sObject> scope) { | |
List<user> userRecord = (List<user>)scope; | |
List<GroupMember> duplicateGroupId = new List<GroupMember>(); | |
Set<Id> userId = new Set<Id>(); | |
for(GroupMember gpm : [Select Id,userorGroupId from GroupMember where userorGroupId IN:userRecord]){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
@author : Karanraj | |
@Description : A Visualforce page to demonstrate the functionality of Remote Objects | |
--> | |
<apex:page showHeader="false" standardStylesheets="false"> | |
<!-- Boostrap and jQuery file --> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class QuickCasecomment | |
{ | |
public QuickCasecomment(ApexPages.StandardController controller) { | |
} | |
@RemoteAction | |
public static boolean CreateComment(Id CaseId,String comment,string publish){ | |
CaseComment newCom = new CaseComment(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger efficientSOQL on Invoice_Statement__c(before insert,before update) | |
{ | |
//perform SOQL query outside the for loop | |
//This query runs once for all item in the Trigger.New | |
for(Invoice_statement__c inv : [Select Id,Description__c,(select Id,Units_Sold__c from Line_Item__r) From Invoice_Statement__c where Id IN : Trigger.newMap.KeySet()]) | |
{ | |
for(Line_Item__c li:inv.LineItem__r) | |
{ | |
//do any operation | |
} |
NewerOlder