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
<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 class Address | |
{ | |
// Internally used to determine if valueOf method should read the state and country picker fields | |
private static Boolean stateAndCountryPickersEnabled = false; | |
static | |
{ | |
// Are State and Country pickers enabled in this org? | |
Map<String, Schema.SObjectField> accountFields = Account.sObjectType.getDescribe().fields.getMap(); | |
stateAndCountryPickersEnabled = accountFields.containsKey('BillingStateCode'); |
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
@IsTest | |
private with sharing class TestPricebook { | |
@IsTest private static void testPricebook() | |
{ | |
System.assertEquals(0, [select Id from Pricebook2 where IsStandard = true].size()); | |
Pricebook2 pb = (Pricebook2) JSON.deserialize('{"Name":"Standard", "IsStandard":"true"}', Pricebook2.class); | |
System.assertEquals(true, pb.IsStandard); | |
insert pb; | |
System.assertEquals(1, [select Id from Pricebook2 where IsStandard = true].size()); | |
} |
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 Opportunities extends fflib_SObjectDomain | |
{ | |
public Opportunities(List<Opportunity> sObjectList) | |
{ | |
// Domain classes are initialised with lists to enforce bulkification throughout | |
super(sObjectList); | |
} | |
public override void onApplyDefaults() | |
{ |
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 OpportunitiesSelector extends fflib_SObjectSelector | |
{ | |
public List<Schema.SObjectField> getSObjectFieldList() | |
{ | |
return new List<Schema.SObjectField> { | |
Opportunity.AccountId, | |
Opportunity.Amount, | |
Opportunity.CloseDate, | |
Opportunity.Description, | |
Opportunity.ExpectedRevenue, |
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" standalone="no"?> | |
<project name="ev3" default="clean" basedir="."> | |
<!-- DEVELOPMENT SECTION --> | |
<property name="environment" value="EV3" /> | |
<property name="project" value="ev3force"/> | |
<property name="version" value="0.1"/> | |
<property name="base.dir" value="." /> | |
<property name="src" location="src"/> | |
<property name="lib" location="${base.dir}/lib" /> |
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
/** | |
* Copyright (c), Andrew Fawcett | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* - Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* - Redistributions in binary form must reproduce the above copyright notice, |
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
/** | |
* Copyright (c), Andrew Fawcett | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* - Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* - Redistributions in binary form must reproduce the above copyright notice, |