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
trigger DF13_ConvertCountryToISO on Account (before insert, before update) { | |
for (Account a: Trigger.new) | |
{ | |
if (a.BillingCountry != null) | |
a.BillingCountryIsoCode__c = Country__c.getValues(a.BillingCountry).BillingCountryIsoCode__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
trigger DF13_labelDemo on Account (before insert, before update) { | |
for (Account a: Trigger.new) | |
if (a.NumberOfEmployees < Account_Fields_Minimal_Value__c.getInstance().Minimal_Number_Of_Employees__c) | |
a.addError(System.Label.Error_SmallNumberOfEmployees); | |
} |
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
trigger DF13_labelDemo on Account (before insert, before update) { | |
for (Account a: Trigger.new) | |
if (a.NumberOfEmployees < 5) | |
a.addError(System.Label.Error_SmallNumberOfEmployees); | |
} |
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
trigger DF13_labelDemo on Account (before insert, before update) { | |
for (Account a: Trigger.new) | |
if (a.NumberOfEmployees < 5) | |
a.addError('Please insert a higher number of Employees'); | |
} |
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
//Salesforce Force.com Apex example: integration using field-set | |
@RestResource(urlMapping='/Account/*') | |
global with sharing class MyRestResource { | |
@HttpGet | |
global static Account doGet() { | |
RestRequest req = RestContext.request; | |
RestResponse res = RestContext.response; | |
String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1); | |
String query = 'SELECT '; |
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="Account"> | |
<apex:messages /> | |
<apex:form > | |
<apex:pageBlock title="My Content" mode="edit"> | |
<apex:pageBlockButtons > | |
<apex:commandButton action="{!save}" value="Save"/> | |
</apex:pageBlockButtons> | |
<apex:pageBlockSection title="My Content Section" columns="2"> | |
<apex:repeat value="{!$ObjectType.Account.FieldSets.SampleFieldSet}" var="f"> | |
<apex:inputField value="{! Account [f]}" required="{!OR(f.required, f.dbrequired)}"/> |