[SalesForce]メールテンプレートの項目一覧
メールテンプレートは、SOQLを使用して、EmailTemplateでとってこれる。
参考:https://developer.salesforce.com/forums?id=906F00000009BOlIAM
取得したEmailTemplateの一覧
(内容は間違っている可能性があります)
| 項目名 | 内容 |
|---|---|
| body | 本文 |
| markup | |
| folderid | フォルダーのID |
| subject | 件名 |
| developername | 作成者 |
| timesused | 使用回数 |
| createddate | 作成日 |
| ownerid | オーナーのID |
| apiversion | |
| createdbyid | 作成者のID |
| lastmodifieddate | 更新日 |
| id | ID |
| brandtemplateid | |
| lastuseddate | 最終使用日 |
| templatestyle | |
| isactive | 有効か |
| namespaceprefix | |
| description | テンプレートの説明 |
| name | テンプレートの一意の名前 |
| templatetype | テンプレートのタイプ |
| encoding | 文字コード |
| systemmodstamp | |
| lastmodifiedbyid | 更新者のID |
| htmlvalue | HTMLテンプレートの場合の本文 |
以下の方法でオブジェクトの項目一覧を取得出来る。
参考:
http://techblog.appirio.co.jp/2012/07/forcecom-apexdescribe.html
http://www30304u.sakura.ne.jp/blog/?p=188
http://vaindespair.blogspot.jp/2012/04/blog-post_04.html
実際に取得したapexコード
public Pagereference getList() {
sObject newObj = (sObject)Type.forName('EmailTemplate').newInstance();
Schema.DescribeSObjectResult descResult = newObj.getsObjectType().getDescribe();
String keys = concatSet(descResult.fields.getMap().keySet(), ', ');
System.debug('***** EmailTemplate keys: ' + keys);
}
private static String concatSet(Set<String> strSet, String sep) {
String retStr;
for (String str : strSet) {
retStr = retStr == null ? str : retStr + sep + str;
}
return retStr == null ? '' : retStr;
}