繁体   English   中英

salesforce自定义字段用例

[英]salesforce custom field use case

在Salesforce中,我想在Contact中创建一个名为“ Chapter”的自定义字段,该字段引用其他2个字段(“州”和“国家”)以自动填充自身。类似于SQL中的情况

例如

‘Chapter' = 
    CASE
       When country = 'Aus' and state in ('NSW', 'ACT') then 'NSW / ACT` 
       When country = 'Aus' and state in ('VIC', 'TAS') then 'VIC / TAS`
       When country = 'Aus' and state in ('SA', 'NT') then 'SA / NT`
       When country = 'Aus' and state in ('WA, 'QLD') then 'WA/QLD'
       When country = 'NZ' then 'NZ'
       When country not in ('Aus', NZ) then 'INT'
    END

我想我在创建字段时使用公式数据类型,但是似乎无法编写公式。

我自己解决了这个问题。 这是使用IF公式的自定义字段

F(Country = "Aus" && State = "NSW" , "NSW/ACT", 
IF(Country = "Aus" && State = "ACT" , "NSW/ACT", 
IF(Country = "Aus" && State = "TAS" , "VIC/TAS", 
IF(Country = "Aus" && State = "VIC" , "VIC/TAS", 
IF(Country = "Aus" && State = "SA" , "SA/NT", 
IF(Country = "Aus" && State = "NT" , "SA/NT", 
IF(Country = "Aus" && State = "WA" , "WA", 
IF(Country = "Aus" && State = "QLD" , "QLD", 
IF(Country = "NZ" , "NZ", 
IF(Country <> "New Zealand" && Country <> "Aus" , "INT", 
""))))))))))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM