試して学ぶ数式項目・入力規則 / Salesforce Formulas and Validation Rules Hands on

4068fcaf4bd4822746cc4537a422eced?s=47 Shun Kosaka
October 31, 2019

試して学ぶ数式項目・入力規則 / Salesforce Formulas and Validation Rules Hands on

4068fcaf4bd4822746cc4537a422eced?s=128

Shun Kosaka

October 31, 2019
Tweet

Transcript

  1. & TERAKOYA EAST Shun Kosaka | Accenture Japan | @shunkosa

  2. ✏ Salesforce Trailhead Playground Developer Edition 1 ✋ • •

    • https://sli.do/ # 8230 2019 10 31 Salesforce TERAKOYA FORCE (Advanced + )
  3. [ ] … 1. 2. 3.

  4. IF(AND(ISBLANK(Terakoya_c), IsActive = true ), ‘ ’, ‘ ’ )

    IF( AND( ISBLANK(Terakoya__c), IsActive = true ), ‘ ’, ‘ ’ ) https://help.salesforce.com/articleView?id=customize_formula_best_practices.htm&type=5 ( ) IF AND OR CASE • • = true
  5. /

  6. Step1. Help MONTH(2017/12/18) = 12 ❌ MONTH(LastModi edDate) ⭕ MONTH(LastModi

    edDate ) /
  7. / Step2. / MONTH(LastModi edDate ) = MONTH(DATEVALUE(LastModi edDate)) =

    12 DATEVALUE(2017/12/18 16:10) = 2017/12/18 STEP1 MONTH
  8. / Step3. ❌ MONTH(DATEVALUE(LastModi edDate)) & ⭕ MONTH(DATEVALUE(LastModi edDate)) &

    & = 12 ( ) ( ) NG 12 ( ) ( ) Apex + +
  9. / Step4. / TEXT(12) = 12 MONTH(DATEVALUE(LastModi edDate)) & =

    TEXT(MONTH(DATEVALUE(LastModi edDate))) & = 12 & = 12
  10. 1. • • 2. • 3. ❌ ⭕ ☺ Owner.ProfileId

    = ’0e28000001qLOa’ …
  11. ON ( ) PRIORVALUE

  12. 1. Playground Developer Edition 2. packaging/installPackage.apexp?p0=04t2v000005aNhH 3. URL lightning.force.com/ 2

    https://brave-badger-180775-dev-ed.lightning.force.com/packaging/instalackage.apexp?p0=04t2v000005aNhH URL OK 4.
  13. 1 OK NG AND( ISPICKVAL(PRIORVALUE(StageName), ‘Value Proposition’), OR( ISPICKVAL(StageName, ‘Needs

    Analysis’), ISPICKVAL(StageName, ‘Qualification’), ISPICKVAL(StageName, ‘Prospecting’) ) ) Value Proposition …
  14. 1 OK NG AND( ISPICKVAL(PRIORVALUE(StageName), ‘Value Proposition’), OR( ISPICKVAL(StageName, ‘Needs

    Analysys’), ISPICKVAL(StageName, ‘Qualification’), ISPICKVAL(StageName, ‘Prospecting’) ) ) Value Proposition …
  15. 1 CASE(StageName, ‘Prospecting’, 1, ‘Qualification, 2, ‘Needs Analysis, 3, …

    … ‘Closed Won’, 9, ‘Closed Lost’,9, 0 ) CASE(PRIOVALUE(StageName), ‘Prospecting’, 1, ‘Qualification, 2, ‘Needs Analysis, 3, … … ‘Closed Won’, 9, ‘Closed Lost’, 9, 0 ) 1 2 3 4 5 6 7 8 9 CASE 0縄 OK
  16. 2 • (TERAKOYA) • a IF(Account.ShippingState = , 500, 700)

  17. 2 • (TERAKOYA) • a IF(Account.ShippingState = , 500, 700)

  18. 2 • (TERAKOYA) • a IF(Account.ShippingState = , 500, 700)

  19. 2 Label Cost__c DeveloperName 500 Tokyo 600 Kanagawa 700 Others

    IF( Account.ShippingState = $CustomMetadata.Terakoya_Shipping_Cost__mdt.Tokyo.MasterLabel, $CustomMetadata.Terakoya_Shipping_Cost__mdt.Tokyo.Cost__c, $CustomMetadata.Terakoya_Shipping_Cost__mdt.Others.Cost__c ) (Terakoya_Shipping_Cost__mdt)
  20. 2 ( ) • • • • • Apex •

    ( ) • Sandbox •
  21. 3 ( ) ⭕ ⭕ ⭕ ⭕ ⭕ ❌ ❌

    ShippingState <> ‘ ’ || ShippingState <> ‘ ’ || ShippingState <> ‘ ’ || … 44 … …
  22. 3 ( ) NOT( CONTAINS( ‘ : : : :

    : : : : : : : : : : : : : 結 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ’ , ShippingState ) ) || LEN(ShippingState) < 3 = ShippingState 3 ( ) OR IF CONTAINS
  23. 4 2 10% 8% ※ (TERAKOYA) ID API (DeveloperName)

  24. 5 (TERAKOYA) 30%縄

  25. 5 ※ TERAKOYA

  26. https://gist.github.com/shunkosa/acf995909947d95174cd7ae5252ae4dd

  27. • • ID • DeveloperName • • • • •

  28. Trailhead Salesforce Help - https://help.salesforce.com/articleView?id=useful_advanced_formulas.htm&type=5

  29. Thank you!