This file contains 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 standardController="Inventario_de_Guardias__c" extensions="CM_GSM_Guard_Location"> | |
<head> | |
<title>Single marker</title> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
</style> |
This file contains 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
try{ | |
update account; | |
} | |
catch (DMLException e){ | |
ApexPages.addMessages(e); | |
Messaging.SingleEmailMessage mail=new Messaging.SingleEmailMessage(); | |
String[] toAddresses = new String[] {'developer@acme.com'}; | |
mail.setToAddresses(toAddresses); | |
mail.setReplyTo('developer@acme.com'); |
This file contains 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
Map<Id, List<Id>> userRoleToUsers = new Map<Id, List<Id>>(); | |
for(User newUser : [SELECT UserRoleId FROM User LIMIT 50000]) { | |
if(userRoleToUsers.containsKey(newUser.UserRoleId)) { | |
List<Id> usersId = userRoleToUsers.get(newUser.UserRoleId); | |
usersId.add(newUser.Id); | |
userRoleToUsers.put(newUser.UserRoleId, usersId); | |
} else { | |
userRoleToUsers.put(newUser.UserRoleId, new List<Id> { newUser.Id }); | |
} |
This file contains 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
<script> | |
(function ($) { | |
var rules = document.styleSheets[document.styleSheets.length-1].cssRules; | |
for (var idx = 0, len = rules.length; idx < len; idx++) { | |
$(rules[idx].selectorText).each(function (i, elem) { | |
elem.style.cssText += rules[idx].style.cssText; | |
}); | |
} | |
$('style').remove(); | |
})(jQuery); |
This file contains 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
/** | |
* A google Maps function to get Latitude and Longitude from Goole Maps API | |
* @author Edgar Yucel Morán Sanchez | |
* @version 1.0 | |
* @date 11/10/2014 | |
*/ | |
public class CL_GoogleMaps_Geolocations { | |
public CL_GoogleMaps_Geolocations() {} |
This file contains 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
select N_mero_de_contrato__c, count(id) num from Contract group by N_mero_de_contrato__c having count(N_mero_de_contrato__c) > 1 |
This file contains 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
Opportunity opp = [Select Id,SyncedQuoteId from Opportunity where Id =:this.id_Opportunity]; | |
opp.SyncedQuoteId = q.Id; |
This file contains 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
public static List<ASANA_User_wrapper> getUsers() { | |
List<ASANA_User_wrapper> list_asana_users = new List<ASANA_User_wrapper>(); | |
HttpRequest aRequest = new HttpRequest(); | |
aRequest.setEndpoint('https://app.asana.com/api/1.0/users'); | |
aRequest.setMethod('GET'); | |
String username = API_KEY; |
This file contains 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
<style> | |
.pbSubheader{ | |
background-color: red !important; | |
border-color: none !important; | |
} | |
</style> |
This file contains 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
//find all Opportunity record types | |
List<Schema.RecordTypeInfo> infos = Schema.SObjectType.Event.RecordTypeInfos; | |
Id defaultRecordTypeId; | |
//check each one | |
for (Schema.RecordTypeInfo info : infos) { | |
if (info.DefaultRecordTypeMapping) { | |
defaultRecordTypeId = info.RecordTypeId; | |
} | |
} |