0

在 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

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

4

1 回答 1

0

我自己解决了这个问题。这是一个使用 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", 
""))))))))))
于 2015-09-15T06:37:22.407 回答