ghjhg" s} {dfgdfg " "
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
public static Map<String, String> ISO3166_1_Alpha2_CountryToCode = new Map<String,String> { | |
'AFGHANISTAN'=>'AF', | |
'ÅLAND ISLANDS'=>'AX', | |
'ALBANIA'=>'AL', | |
'ALGERIA'=>'DZ', | |
'AMERICAN SAMOA'=>'AS', | |
'ANDORRA'=>'AD', | |
'ANGOLA'=>'AO', | |
'ANGUILLA'=>'AI', | |
'ANTARCTICA'=>'AQ', |
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
//Adapted from http://boards.developerforce.com/t5/Apex-Code-Development/Detect-a-required-field-in-Apex/td-p/129693 | |
Map<String, Schema.SObjectField> describeFields = Schema.SObjectType.Bank__c.fields.getMap(); | |
//CREATE A MAP WITH FIELD NAME AS KEY AND A BOOLEAN (Required) AS VALUE | |
Map<String, Boolean> fieldIsRequired = new Map<String, Boolean>(); | |
Map<String, Schema.DisplayType> fieldsTypes = new Map<String, Schema.DisplayType>(); | |
for(String field : describeFields.keyset()){ | |
Schema.DescribeFieldResult desribeResult = describeFields.get(field).getDescribe(); |
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
//dataRow is the class that Salesforce applies to all data rows, but you could equally use this in a non Salesforce context | |
$(".dataRow").click(function(event) | |
{ | |
//Ignore link and checkbox clicks, otherwise find the row's checkbox and click it | |
if(event.target.type!=="checkbox" && !$(event.target).is('a')) { | |
$(this).find($("input:checkbox")).click(); | |
} | |
}); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Excel = Microsoft.Office.Interop.Excel; | |
namespace AnalysisSuite.Extensions | |
{ | |
public static class ObjectExtensions | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Excel = Microsoft.Office.Interop.Excel; | |
using MyExtensions | |
namespace MyExtensions | |
{ | |
public static class ExcelExtensions |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace MyExtensions | |
{ | |
public static class DateTimeExtensions | |
{ |
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
on run {input, parameters} | |
tell application "System Events" | |
set MyList to (name of every process) | |
end tell | |
set nameOfFocusedApp to name of (info for (path to frontmost application)) | |
if (MyList contains "QuickTime Player" and nameOfFocusedApp is "QuickTime Player.app") is true then | |
tell application "QuickTime Player" |
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
//Import script using rawgithub workaround site (as opposed to raw.github which doesn't work and is currently used on the page) | |
var jq = document.createElement('script'); | |
jq.src = "https://rawgithub.com/rfong/graph-editor.js/master/build/graph-editor.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
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
//Static resource called parsley contains just the parsley.js file. Ditto jQuery. In a non-sf context, | |
// I'm sure you can work it out :) | |
<apex:includeScript value="{!$Resource.jQuery}"/> | |
<apex:includeScript value="{!$Resource.parsley}"/> | |
//An example of using the parsley.js (http://parsleyjs.org/) form validation framework in Salesforce, | |
// on a bootstrapified page (this should[?] work equally well on a non-bootstrap page - it just uses | |
// bootstrap class names where appropriate). | |
//Note that as salesforce doesn't allow "custom" attributes in <apex> elements (this uses HTML5 | |
// data-* attributes), this uses the javascript method of initialising parsley. In a non-sf context, |
OlderNewer