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 with sharing class AssertCallback { | |
private static Map<Type, IAssertCallback> callbacks = new Map<Type, IAssertCallback>(); | |
public interface IAssertCallback | |
{ | |
void assert(String location, Object state); | |
} | |
public static void assert(Type stateType, String location, Object state) |
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 with sharing class MetadataServicePatcher { | |
// Perhaps parse these from the WSDL in the future | |
private static final Map<String, String> METADATA_TYPES = | |
new Map<String, String> { | |
'CustomSite' => 'Metadata', | |
'InstalledPackage' => 'Metadata', | |
'CustomField' => 'Metadata', | |
'FieldSet' => 'Metadata', | |
'PicklistValue' => 'Metadata', |
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
//Generated by wsdl2apex | |
public class MetadataService { | |
public class listMetadataResponse_element { | |
public MetadataService.FileProperties[] result; | |
private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'}; | |
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'}; | |
private String[] field_order_type_info = new String[]{'result'}; | |
} | |
public class FieldOverride { |
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
PermissionSet permissionSet = new PermissionSet(); | |
permissionSet.Name='ApexTest'; | |
permissionSet.label='Apex Test'; | |
insert permissionSet; | |
ObjectPermissions objectPermission = new ObjectPermissions(); | |
objectPermission.ParentId = permissionSet.Id; | |
objectPermission.SObjectType = Book_Order__c.SObjectType.getDescribe().getName(); | |
objectPermission.PermissionsEdit = true; | |
objectPermission.PermissionsRead = true; | |
objectPermission.PermissionsDelete = true; |
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
<project> | |
<target name="cloud9.github.init"> | |
</target> | |
<target name="sync.from.cloud9"> | |
<sync todir="src/classes" verbose="true"> | |
<fileset dir="${basedir}/classes"> | |
<exclude name="**/.c9/**"/> | |
</fileset> | |
</sync> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Flow xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<actionCalls> | |
<name>TaskReminder</name> | |
<label>TaskReminder</label> | |
<locationX>21</locationX> | |
<locationY>32</locationY> | |
<actionName>NewTask</actionName> | |
<actionType>quickAction</actionType> | |
<inputParameters> |
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 with sharing class EinsteinAction { | |
public class Prediction { | |
@InvocableVariable | |
public String label; | |
@InvocableVariable | |
public Double probability; | |
} | |
@InvocableMethod(label='Classify the given files' description='Calls the Einsten API to classify the given ContentVersion files.') |
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 controller="RemoteObjectDemoController"> | |
<apex:remoteObjects > | |
<apex:remoteObjectModel name="WorkOrder__c" fields="Id,Name,AccountName__c,Cost__c"/> | |
<apex:remoteObjectModel name="WorkOrderLineItem__c" fields="Id,Name,Description__c,Hours__c,WorkOrder__c"/> | |
</apex:remoteObjects> | |
<script> | |
function doSomethingJS(answer) | |
{ | |
// Create work order | |
var workOrder = new SObjectModel.WorkOrder__c(); |
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 with sharing class ValidationController | |
{ | |
private ApexPages.StandardController standardController; | |
public ValidationController(ApexPages.StandardController standardController) | |
{ | |
// Configure fields to query and valid (alternative to SOQL) | |
this.standardController = standardController; | |
if(!Test.isRunningTest()) | |
this.standardController.addFields( |
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
/** | |
* | |
CustomMetadata.Operations | |
.callback( | |
// Platform event for deploy status | |
MetadataDeployment__e.getSObjectType(), | |
MetadataDeployment__e.DeploymentId__c, | |
MetadataDeployment__e.Result__c) | |
.enqueueUpsertRecords( | |
// Metadata record type |