Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Salesforceのツールの作り方

tzmfreedom
September 26, 2019

 Salesforceのツールの作り方

Salesforce World Tour Tokyo 2019で登壇したときの資料です

tzmfreedom

September 26, 2019
Tweet

More Decks by tzmfreedom

Other Decks in Technology

Transcript

  1. Salesforceͷπʔϧͷ࡞Γํ
    ా࣮ ੣

    View full-size slide

  2. ࣗݾ঺հ
    • Twitter: @tzm_freedom
    • GitHub: tzmfreedom
    • Blog: https://blog.freedom-man.com
    • ࣄۀ։ൃձࣾͷαʔόʔαΠυΤϯδχΞ
    • Ruby/Rails, PHP/Symfony, ...
    • ࠷ۙ͸ϨΨγʔΞϓϦվળۀ
    • Ϟϊͮ͘Γେ޷͖ܥΤϯδχΞ
    • Salesforceͷܦݧ͸લ৬Ͱ5೥൒͘Β͍
    • Salesforceͷࢿ֨͸શࣦͯޮʘ(^o^)ʗ
    • ࠓ͸ۀ຿ͰSalesforceΛશ͘৮͍ͬͯͳ͍

    View full-size slide

  3. ࠓ·Ͱ࡞͖ͬͯͨπʔϧ
    • go-soapforce: Go੡ͷSalesforce SOAP APIΫϥΠΞϯτ
    • hsforce: Haskell੡ͷSalesforce APIΫϥΠΞϯτ
    • fluent-plugin-sforce: fluentdͷSalesforceϓϥάΠϯ
    • embulk-output-salesforce: embulkͷSalesforceϓϥάΠϯ
    • hubot-chatter: hubotͷSalesforceΞμϓλ
    • spm: SalesforceͷύοέʔδϚωʔδϟʔ
    • land: ApexͷϩʔΧϧ࣮ߦ؀ڥ
    • alt-apex: ApexΛKotlinͰॻ͚ΔΑ͏ʹ͢ΔτϥϯεύΠϥ

    View full-size slide

  4. ࠓ೔࿩͢͜ͱ
    • πʔϧΛ࡞Δʹ͸Ͳ͏͍͏஌ࣝɾٕज़ɾࢹ఺͕ඞཁͳ
    ͷ͔ʁ
    • ಛʹπʔϧ։ൃʹ͓͚ΔϞνϕʔγϣϯ໰୊ʹ͍ͭͯ
    • πʔϧΛ࡞Δ۩ମతͳํ๏Ͱ͸ͳ͘ɺϝλͳࢹ఺Ͱ͓
    ࿩͠·͢

    View full-size slide

  5. ※͜ͷηογϣϯͷεϥΠυ͸
    จࣈ͔͠ग़͖ͯ·ͤΜʂ

    View full-size slide

  6. Salesforce։ൃΛࢧ͑Δπʔϧ͸ͨ͘͞Μ͋Δ
    • Apex։ൃʢGUIɾEditorʣ
    • ݹ͘͸ force.com IDEɺݱࡏ͸VS Codeʴplugin
    • Salesforceૢ࡞؆қԽʢChrome Extension)
    • Salesforce Devtools
    • σʔλ౤ೖʢGUIʣ
    • Salesforce Dataloader
    • σϓϩΠͷࣗಈԽʢCUIʣ
    • ant, sfdx, jsforce
    • APIΛୟ͘ϥΠϒϥϦ
    • jsforce(JavaScript), restforce(Ruby), go-soapforce(Go), ...

    View full-size slide

  7. πʔϧΛ࡞ΔͨΊʹ
    ඞཁͳ஌ࣝɾٕज़ɾࢹ఺

    View full-size slide

  8. 1. SalesforceΛ஌Δ

    View full-size slide

  9. Salesforceʹ͍ͭͯ஌Δ
    • SalesforceͰग़དྷΔ͜ͱग़དྷͳ͍͜ͱ
    • ։ൃͤͣʹͰ͖ΔྖҬͱͰ͖ͳ͍ྖҬͷཧղ
    • SalesforceΛΧελϚΠζɾ։ൃ্͍ͯ͘͠ͰͲ͏͍͏ۀ
    ຿͕සൃ͢Δͷ͔
    • SalesforceϓϥοτϑΥʔϜ͸Կ͕ۤखͳͷ͔
    • ۤखͳྖҬʹରͯ͠ผͷΞϓϩʔνͰิ͑Δ΋ͷͳͷ͔
    • Salesforce͕ެࣜʹఏڙ͍ͯ͠Δπʔϧ
    • Dataloader, SFDX, VS Code Plugin...
    • ෆศͰ͸ͳ͍͔ʁࣗࣾυϝΠϯʹϑΟοτ͍ͯ͠Δ͔ʁ

    View full-size slide

  10. 2. ՝୊Λղܾ͢ΔͨΊͷ
    ٕज़Λ஌Δ

    View full-size slide

  11. ՝୊Λղܾ͢ΔͨΊͷٕज़Λ஌Δ
    • Salesforceͷը໘ΛΑΓ࢖͍΍͍ͨ͘͢͠

    => Chrome֦ுɾϒοΫϚʔΫϨοτɾϢʔβʔεΫϦϓτ
    • CLIͰSalesforceΛૢ࡞͍ͨ͠

    => CLIπʔϧʢCLIϑϨʔϜϫʔΫ oclifͱ͔Thorͱ͔ʣ
    • WebΞϓϦͰSalesforceͷAPIΛୟ͘

    => APIΫϥΠΞϯτʢRESTɾSOAPɾMetadataɾToolingʣ
    • σʔλΛ͍͍ײ͡ʹ͢ΔGUIΛ࡞Γ͍ͨ

    => WebΞϓϦɾσεΫτοϓΞϓϦɾεϚϗΞϓϦ
    • ੌ͍OSS͕ग़͚ͨͲSalesforce༻ͷϓϥάΠϯ͕ແ͍ʂ

    => OSSͷϓϥάΠϯ

    View full-size slide

  12. ՝୊Λղܾ͢ΔͨΊͷٕज़Λ஌Δ
    • ެ։ɾΠϯετʔϧํ๏
    • GitHub
    • ֤छύοέʔδ؅ཧγεςϜ
    • WebΞϓϦ
    • Heroku Button
    • Salesforce Button
    • bashϫϯϥΠφʔ
    • Πϯετʔϥʔ
    • ·͊Ͱ΋ͿͬͪΌ͚ٕज़ͳΜͯޙ෇Ͱ͓̺ʢޙड़

    View full-size slide

  13. 3. ϞνϕʔγϣϯΛҡ࣋ͯ͠
    ࡞Γ੾Δྗ

    View full-size slide

  14. ࣮͸πʔϧΛ࡞ΔٕྔΑΓ΋
    ϞνϕʔγϣϯΛҡ࣋ͯ͠
    ࡞Γ੾Δͷ͕Ұ൪೉͍͠

    View full-size slide

  15. πʔϧ։ൃͷϞνϕʔγϣϯ໰୊
    • ԿΛ࡞͍͍ͬͯͷ͔Θ͔Βͳ͍…
    • ࣅͨΑ͏ͳπʔϧ͕͋Δ͠ंྠͷ࠶ൃ໌ʹͳͬͯ͠
    ·͏ͷͰ͸…
    • ៉ྷͳίʔυॻ͚ͳ͍͠ɺίʔυΛެ։͢Δͷ͕ஏ
    ͔͍ͣ͠…
    • ͦ΋ͦ΋͜ͷπʔϧ࡞ͬͯҙຯ͋ΔͷͩΖ͏͔…
    • ࡞Γ͍ͨ΋ͷ͕͋Δ͚Ͳ೉қ౓͕ߴ͍…

    View full-size slide

  16. ԿΛ࡞͍͍ͬͯͷ͔Θ͔Βͳ͍…

    View full-size slide

  17. ԿΛ࡞ͬͯྑ͍ͷ͔Θ͔Βͳ͍
    • ෆศʹؾͮ͘ɻ౰ͨΓલΛٙ͏ɻ
    • ৗʹ٬؍తʹݟͯΈΔɻ
    • Salesforce͸˓˓ͳ࢓༷͔ͩΒ͠ΐ͏͕ͳ͍ɺఘΊΔ…
    Ͱ͸ͳ͘ɺ։ൃͰϑΥϩʔͰ͖ͳ͍΋ͷͳͷ͔ɺͲ͏ͳ
    Ε͹΋ͬͱศརʹ࢖͑Δͷ͔Λߟ͑Δɻ
    • Salesforce͸API͕ॆ࣮͍ͯ͠ΔͷͰ։ൃͰϑΥϩʔͰ
    ͖Δൣғ͸޿͍
    • ӡ༻ऀɾ։ൃऀʹෆศͳ఺͕ແ͍͔ฉ͍ͯΈΔ
    • ໨త͸SalesforceΛΑΓศརʹ࢖͑ΔΑ͏ʹ͢Δ͜ͱ

    View full-size slide

  18. ࣅͨΑ͏ͳπʔϧ͕͋Δ͠
    ंྠͷ࠶ൃ໌ʹͳͬͯ͠·͏ͷͰ͸…

    View full-size slide

  19. ࣅͨΑ͏ͳπʔϧ͕͋Δ͠ंྠͷ࠶ൃ໌ʹͳͬͯ͠·͏ͷͰ͸…
    • ंྠͷ࠶ൃ໌্౳
    • ׬શʹಉ͡πʔϧͱ͍͏ͷ͸ଘࡏ͠ͳ͍
    • ࡉ͔͍࢖͍উखɺඞཁͳϥϯλΠϜ
    • ಉ͡Α͏ͳπʔϧ͕Կݸ͋ͬͯ΋ྑ͍
    • ࣗ෼ͷٕज़ྗ͸࣮֬ʹ্͕Δ
    • ࣅͨΑ͏ͳπʔϧʹର͢Δཧղྗ΋্͕Δ
    • ཧղྗ্͕͕ΔͱτϥϒϧγϡʔςΟϯάʹ΋ڧ͘ͳΔ

    View full-size slide

  20. ៉ྷͳίʔυॻ͚ͳ͍͠
    ίʔυΛެ։͢Δͷஏ͔͍ͣ͠…

    View full-size slide

  21. ៉ྷͳίʔυॻ͚ͳ͍͠ɺίʔυΛެ։͢Δͷஏ͔͍ͣ͠…
    • ͦ΋ͦ΋࠷ॳ͔Β៉ྷͳίʔυͳΜͯॻ͚ΔΘ͚͕ͳ͍
    • ແཧʹެ։͠ͳͯ͘΋ྑ͍͠ɺ࠷ॳ͸ࣾ಺πʔϧͰશ͘໰
    ୊ͳ͍
    • ͕ɺίʔυΛެ։͢ΔϝϦοτ͸͔ͳΓ͋ΔͷͰ͓͢͢Ί
    • ঝೝཉٻΛຬͨ͢
    • ιʔγϟϧίʔσΟϯάΛମݧͰ͖Δ
    • ެ։͢Δͱ͍͏ϓϨογϟʔͰ඼্࣭͕͕Δ
    • ҙ֎ͱଞͷਓʹͱͬͯ΋༗༻ͳπʔϧͰ͋Δ͜ͱ͕ଟ͍
    • ެ։ͯ͠΋ҙ֎ͱ୭΋ݟ͍ͯͳ͍ͷͰؾʹ͢Δඞཁ͕ͳ͍
    • ެ։ʹଛͰ͸ͳ͍ɻ

    View full-size slide

  22. ͦ΋ͦ΋͜ͷπʔϧΛ࡞ͬͯ
    ҙຯ͋ΔͷͩΖ͏͔…

    View full-size slide

  23. ͦ΋ͦ΋͜ͷπʔϧΛ࡞ͬͯҙຯ͋ΔͷͩΖ͏͔…
    • ҙຯ͸࡞ͬͨ͋ͱʹߟ͑ͯ΋ྑ͍
    • ͱΓ͋͑ͣϓϩτλΠϐϯάతʹਖ਼ৗܥ͚ͩ࡞ͬͯΈΔ
    • ҙຯΛߟ͑Δલʹ׬੒ͤ͞Δ
    • ҙ֎ͱ࢖ͬͯ͘ΕΔਓ͕͍ͨΓ͢Δ΋ͷ
    • ໾ʹཱͨͳͯ͘΋ྑ͍ɻָ͚͠Ε͹OK
    • ϓϩάϥϛϯά͸ָ͍͠

    View full-size slide

  24. ࡞Γ͍ͨ΋ͷ͕͋Δ͚Ͳ
    ೉қ౓͕ߴ͍…

    View full-size slide

  25. ࡞Γ͍ͨ΋ͷ͕͋Δ͚Ͳ೉қ౓͕ߴ͍…
    • ೉қ౓͕ߴ͍΋ͷΛ࡞Γ͍ͨͱࢥͬͨͱ͖͸ࣗ෼ͷٕ
    ज़ྗΛߴΊΔେ͖ͳνϟϯε
    • ن໛͕େ͖͍ɺ೉қ౓͕ߴ͍΋ͷ͸޻ఔɾඞཁͳٕज़
    ཁૉΛ෼ղ͢Δ
    • ̍೔ʙ̍िؒ͘Β͍Ͱୡ੒Ͱ͖Δখ͍͞໨ඪΛ࡞ͬͯ
    ͓͘
    • ·ͣ͸௒؆୯ͳਖ਼ৗܥΛಈ͔͢ɻ͔ͦ͜Β޿͍͛ͯ͘
    • ࡞Γͳ͕ΒֶͿɺֶͿͨΊʹ࡞Δ

    View full-size slide

  26. πʔϧΛ࡞Δ্Ͱ
    େࣄʹ͍ͯ͠Δ͜ͱ

    View full-size slide

  27. πʔϧΛ࡞Δ্Ͱେࣄʹ͍ͯ͠Δ͜ͱ
    • ͍͔ͭ΍ΔɺͰ͸ͳ͘ࠓ΍ΔɻίʔυΛॻ͘ɻ
    • ΍Γͨ͘ͳͬͨͱ͖͕νϟϯεɻ৸͔͢ͱϞνϕʔγϣϯԼ
    ͕ͬͯ΍Βͳ͘ͳΔɻνϟϯεΛಀ͞ͳ͍
    • Ϟνϕʔγϣϯ͸Լ͕Δ΋ͷɻਖ਼ৗܥ͚ͩͰ΋Ұؾʹ࡞Γ੾Δ
    • ධ࿦ՈʹͳΒͳ͍ɺ·ͣखΛಈ͔͢ɻ
    • ΞΠσΞΛΞΠσΞͰऴΘΒͤͳ͍ɻ

    ࣮૷ͯ͠۩ݱԽͰ͖Δͷ͕ΤϯδχΞͷڧΈ
    • ۩ݱԽͰ͖Δ΋ͷΛ૿΍͍͚ͯ͠Δͷ͕ΤϯδχΞͷָ͠Έ
    Ͱ͋ΓՁ஋ʹͳΔ
    • ԿΑΓɺϓϩάϥϛϯάΛָ͠ΉɻϞϊͮ͘Γ͸ָ͍͠ɻ

    ϓϩάϥϛϯά͕໨తʹͳͬͯ΋ྑ͍ɻ

    View full-size slide

  28. ·ͱΊ
    • SalesforceͷπʔϧΛ࡞Δͷʹඞཁͳ஌ࣝɾٕज़ɾࢹ఺
    • SalesforceΛ஌Δ
    • ՝୊ղܾ͢ΔͨΊͷٕज़Λ஌Δ
    • ϞνϕʔγϣϯΛҡ࣋ͯ͠࡞Γ੾Δ
    • ΞΠσΞΛ࣮ݱͰ͖Δͷ͕ΤϯδχΞͷՁ஋ɻ

    ίʔυΛॻ͍͍͖ͯ·͠ΐ͏ʂ

    View full-size slide

  29. Enjoy Programming!!

    View full-size slide