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
| # ディレクトリ構成 | |
| ├── apidocs | |
| │ ├── api.md | |
| │ ├── layout.md | |
| │ └── questions.md | |
| ├── gulpfile.js | |
| ├── package.json | |
| └── published | |
| ├── index.html | |
| └── index.md |
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 class ComponentController { | |
| public String opportunityId {get; set;} | |
| public Opportunity getOpp() { | |
| System.debug(LoggingLevel.INFO, this.opportunityId); | |
| return [ | |
| SELECT | |
| Name, |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <SecuritySettings xmlns="http://soap.sforce.com/2006/04/metadata"> | |
| <passwordPolicies> | |
| <!-- historyRestriction が 0 だと expiration は Never にできない --> | |
| <expiration>Never</expiration> | |
| <historyRestriction>3</historyRestriction> | |
| </passwordPolicies> | |
| </SecuritySettings> |
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
| FORMAT: 1A | |
| HOST: http://polls.apiblueprint.org/ | |
| # MyFirstAPI | |
| Polls is a simple API allowing consumers to view polls and vote in them. |
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 class HttpCallout { | |
| @future(callout=true) | |
| public static void sendVF() { | |
| // 名前空間を指定していると /services/apexrest/[namespace]/sendPDFEmail となる | |
| String serviceUrl = '/services/apexrest/sendPDFEmail'; | |
| String endpoint = URL.getSalesforceBaseUrl().toExternalForm() + serviceUrl; | |
| HttpRequest req = new HttpRequest(); | |
| req.setEndpoint(endpoint); |
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
| <apex:page renderAs="pdf" standardController="Opportunity" showHeader="false" sidebar="false" applyBodyTag="false" applyHtmlTag="false"> | |
| <html> | |
| <head> | |
| <style> | |
| @page { | |
| size: 8.27in 11.69in; | |
| margin: 10px; | |
| } | |
| body { | |
| font-family: 'Arial Unicode MS'; |
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
| Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
| // この書き方だと活動履歴には残らない | |
| // String[] toAddresses = new String[] { [Toに指定したいアドレス] }; | |
| // mail.setToAddresses(toAddresses); | |
| Contact to = [SELECT Id FROM Contact WHERE Id = ...]; | |
| mail.setTargetObjectId(c.Id); | |
| List<String> ccAddresses = new List<String> { [Ccに指定したいアドレス] }; |
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
| /** | |
| * 添付ファイルつきのメールを送信するサンプル | |
| */ | |
| // メール | |
| Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
| mail.setToAddresses(new List<String> { '[email protected]' }); | |
| mail.setSubject('Mail Subject'); | |
| mail.setPlainTextBody('Mail body'); |
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
| // すべてのSObjectを取得する場合 | |
| Map<String, Schema.SObjectType> sMap = Schema.getGlobalDescribe(); | |
| // SObjectの種類を指す | |
| Schema.SObjectType eventType = Event.SObjectType; | |
| // または、インスタンスから取得 | |
| SObject sObj = new Account(); | |
| Schema.SObjectType accountType = sObj.getSObjectType(); | |
| // Schema.DescribeSObjectResultというクラスを経由する |
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
| {!REQUIRESCRIPT('/soap/ajax/33.0/connection.js')}; | |
| var ids = {!GETRECORDIDS($ObjectType.Lead)}, | |
| idsStr = ids.toString().replace(/,/g, "','"); | |
| query = "SELECT Name FROM Lead WHERE Id IN ('" + idsStr + "')", | |
| records = sforce.connection.query(query).getArray('records'); | |
| if (records.length === 0) { | |
| alert('1つ以上選択してください'); | |
| } else { |