9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Salesforceカスタム項目のデータ型(DisplayType、SOAPType、Primitive)

Last updated at Posted at 2015-06-09

Salesforceでカスタム項目を作成して、Apexコードで扱う際にどのデータ型で扱えばいいのか都度調べていたのでまとめてみました。
正規のリファレンスと、Schema.DescribeFieldResultから取得できる情報を突き合わせただけです。いま開発しているシステムがSalesforceのオブジェクトを抽象化、同一視して扱うっていう特殊なものだから必要なんであって、普通はそんなに需要ないですかね。

項目/型一覧

カスタム項目 データ型 DisplayType Enum SOAPType Enum Primitive型
自動採番 string String String string
数式 calculated 戻り値のデータ型次第 戻り値のデータ型次第 戻り値のデータ型次第
外部参照関係 ? ? ? ?
参照関係 ID ID ID string
主従関係 ID ID ID string
URL url URL String string
チェックボックス boolean Boolean Boolean boolean
テキスト string String String string
テキスト(暗号化) encryptedstring EncryptedString String string
テキストエリア textarea Textarea String string
パーセント percent Percent Double double
メール email Email String string
テキストエリア (リッチ) textarea TextArea String string
ロングテキストエリア textarea TextArea String string
数値 number Double Double double
選択リスト picklist Picklist String string
選択リスト (複数選択) multiPicklist MultiPicklist String string
地理位置情報 location Location Location
通貨 currency Currency String string
電話 phone Phone String string
日付 date Date Date date
日付/時間 date Datetime Datetime datetime

memo

  • データ型のstring/date/number/booleanはanyTypeデータ型
  • 外部参照関係とか地理位置情報は使ったことがないのでよくわからない
  • DisplayType/SOAPType EnumにはIntegerがあるが、カスタム項目では定義できない?
    (リードとか取引先の従業員数(標準項目)がIntegerだった)
9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?