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
#!/usr/bin/python | |
import xmltodict | |
import glob | |
def getProfiles(): | |
profiles = glob.glob('profiles/*.profile') | |
rows = getCSVShell(profiles[0]) | |
for profile in profiles: | |
addColumns(profile, rows) |
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
// must be in edit page of particular profile | |
// e.g., https://cs15.salesforce.com/00ee0000000Lw5d/e?s=ObjectsAndTabs&o=Account | |
// will add read to every field. | |
// doesnt change edit permissions | |
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
function main(){ |
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
List<Case> c = [SELECT Id, isDeleted FROM Case WHERE Id = '500C000000VlnSsIAJ']; | |
system.debug(c.size()); //1 | |
//Formula field | |
c = [SELECT Id, Created_During_Business_Hours__c FROM Case WHERE Id = '500C000000VlnSsIAJ']; | |
system.debug(c.size()); //0 | |
//Created_During_Business_Hours__c uses this field in formula | |
c = [SELECT Id, Actual_Case_Start_Time__c FROM Case WHERE Id = '500C000000VlnSsIAJ']; | |
system.debug(c.size()); //0 |
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
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
function main(){ | |
var formulaFieldCells = $("td:contains('Formula (')"); | |
var fieldList = []; | |
formulaFieldCells.each(function(){ | |
formulaField = $($(this).prev()[0]).html(); |
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
import xmltodict | |
OBJECT_NAME = 'Case_Backup.object' | |
PICKLIST_FIELD = 'Team__c' | |
def parseRecordTypes(): | |
for recordType in getRecordTypes(): | |
parseRecordType(recordType) | |
def parseRecordType(recordType): |
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
MetadataService.MetadataPort service = new MetadataService.MetadataPort(); | |
service.SessionHeader = new MetadataService.SessionHeader_element(); | |
service.SessionHeader.sessionId = UserInfo.getSessionId(); | |
MetadataService.Layout layout = (MetadataService.Layout) service.readMetadata('Layout', new String[] { 'Account-Account Layout' }).getRecords()[0]; | |
system.debug(JSON.serializePretty(layout.layoutSections[0].layoutColumns[0].layoutItems[0].field)); | |
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>(); | |
MetadataService.ListMetadataQuery queryListView = new MetadataService.ListMetadataQuery(); | |
queryListView.type_x = 'ListView'; |
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
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
var outputString = ''; | |
function getAPISafeLabel(name){ | |
name = name.replace(/\ /g,'_'); | |
name = name.replace(/\//g,'_'); | |
name = name.replace(/\,/g,'_'); |
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
string GROUP_NAME = 'LodgeOps Knowledge'; | |
CollaborationGroup myGroup = [SELECT Id, Name FROM CollaborationGroup WHERE Name = :GROUP_NAME]; | |
system.debug(myGroup); | |
List<User> pactUsers = [SELECT Id FROM User WHERE Profile.Name = 'Lodging Operations - PAC' AND isActive = true]; | |
List<CollaborationGroupMember> groupMembers = new List<CollaborationGroupMember>(); | |
for (User u : pactUsers){ | |
groupMembers.add( | |
new CollaborationGroupMember(memberId = u.Id, CollaborationGroupId = myGroup.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
global class FlexQueueExample implements Database.Batchable<sObject>{ | |
global Iterable<sObject> start(Database.BatchableContext BC) { | |
return new List<sObject> {}; | |
} | |
global void execute(Database.BatchableContext BC, List<sObject> scope){} | |
global void finish(Database.BatchableContext BC){} | |
// Works in Execute Anonymous for Count <= 100 |
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
// This adds item to Batch Queue (limit 5, until FlexQueue) | |
// platform handles chunking up into batches of 200 records | |
// thus, getting new context of limits every batch | |
// Seems to be a Salesforce bug around FlexQueue in tests: | |
// See: https://gist.github.com/mickle00/70179703e885292793a0 | |
// Also: https://twitter.com/mickle00/status/514511124125851648 | |
Database.executeBatch(new VIPCSATSummaryUpdates()); | |
OlderNewer