码迷,mamicode.com
首页 > 其他好文 > 详细

SF-Custom Setting(自定义设置)

时间:2015-09-22 01:21:00      阅读:622      评论:0      收藏:0      [点我收藏+]

标签:

可以用Custom Setting(自定义设置)的地方:
  • Formula Fields
  • Validation Rules
  • Apex Code
  • Web Services API
可以Custom Setting的类型:
  • List:一个Custom Object的一个Label,会对应多个值。根据选择的参数不同,选出不同的值。
    • 常用方法:
      • getAll()
      • getInstance(dataSetName)
      • getValues(dataSetName)
  • Hierarchy:一个Custom Object的一个Label只会对应一个值。这个值,可以根据,不同的profile或是不同的user来设置,或是设置一个全局的值。
    • 常用方法:
      • getInstance()
      • getInstance(userId)
      • getInstance(profileId)
      • getOrgDefaults()
      • getValues(userId)
      • getValues(profileId)
创建Custom Setting:
  1. 先要创建一个对象,
  2. 再创建这个对象的字段
  3. 进入这个对象的Manage:用来管理这个Custom Setting对象的数据
  4. 现在,它就是一个普通对象了,可以用这个对象的实例来取这个对象中的每个字段的值。

参考文档:

  http://blog.jeffdouglas.com/2010/01/07/using-list-custom-settings-in-salesforce-com/

  https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm

SF-Custom Setting(自定义设置)

标签:

原文地址:http://www.cnblogs.com/donny-sf/p/4827751.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!