<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Salesforce on kenji.blog</title><link>http://kenji.blog/zh-tw/tags/salesforce/</link><description>Recent content in Salesforce on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><copyright>kenjinote</copyright><lastBuildDate>Sun, 09 Apr 2023 02:50:30 +0900</lastBuildDate><atom:link href="http://kenji.blog/zh-tw/tags/salesforce/index.xml" rel="self" type="application/rss+xml"/><item><title>如何使用 Salesforce SOQL 獲取每天建立的記錄數</title><link>http://kenji.blog/zh-tw/p/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-salesforce-soql-%E7%8D%B2%E5%8F%96%E6%AF%8F%E5%A4%A9%E5%BB%BA%E7%AB%8B%E7%9A%84%E8%A8%98%E9%8C%84%E6%95%B8/</link><pubDate>Sun, 09 Apr 2023 02:50:30 +0900</pubDate><guid>http://kenji.blog/zh-tw/p/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8-salesforce-soql-%E7%8D%B2%E5%8F%96%E6%AF%8F%E5%A4%A9%E5%BB%BA%E7%AB%8B%E7%9A%84%E8%A8%98%E9%8C%84%E6%95%B8/</guid><description>&lt;img src="http://kenji.blog/p/salesforce%E3%81%AEsoql%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6%E6%97%A5%E5%88%A5%E3%81%AE%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E4%BD%9C%E6%88%90%E6%95%B0%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/img.png" alt="Featured image of post 如何使用 Salesforce SOQL 獲取每天建立的記錄數" />&lt;h1 id="如何使用-salesforce-soql-獲取每天建立的記錄數">如何使用 Salesforce SOQL 獲取每天建立的記錄數
&lt;/h1>&lt;ol>
&lt;li>開啟開發者控制台。&lt;/li>
&lt;li>開啟 &lt;code>Query Editor&lt;/code> 索引標籤。&lt;/li>
&lt;li>貼上並執行以下 SOQL。&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-sql" data-lang="sql">&lt;span class="line">&lt;span class="cl">&lt;span class="k">select&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">day_only&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">createdDate&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">count&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">createdDate&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">from&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">account&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">group&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">day_only&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">createdDate&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">order&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">count&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">createdDate&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">desc&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">limit&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">10&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>請將 &lt;code>account&lt;/code> 更改為您想要獲取的任何物件名稱並執行。&lt;/p>
&lt;h1 id="參考">參考
&lt;/h1>&lt;ul>
&lt;li>&lt;a class="link" href="https://stackoverflow.com/questions/9187737/is-there-a-way-to-group-by-the-date-portion-of-a-datetime-field-in-soql" target="_blank" rel="noopener"
>Is there a way to group by the date portion of a datetime field in SOQL?&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Salesforce Chatter 全刪除指令</title><link>http://kenji.blog/zh-tw/p/salesforce%E3%83%81%E3%83%A3%E3%83%83%E3%82%BF%E3%83%BC%E5%85%A8%E6%B6%88%E3%81%97%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/</link><pubDate>Mon, 19 Sep 2022 21:59:14 +0900</pubDate><guid>http://kenji.blog/zh-tw/p/salesforce%E3%83%81%E3%83%A3%E3%83%83%E3%82%BF%E3%83%BC%E5%85%A8%E6%B6%88%E3%81%97%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/</guid><description>&lt;img src="http://kenji.blog/p/salesforce%E3%83%81%E3%83%A3%E3%83%83%E3%82%BF%E3%83%BC%E5%85%A8%E6%B6%88%E3%81%97%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/img_1.png" alt="Featured image of post Salesforce Chatter 全刪除指令" />&lt;h1 id="salesforce-chatter-全刪除指令">Salesforce Chatter 全刪除指令
&lt;/h1>&lt;p>這是一個用來刪除 Salesforce Chatter 中所有貼文和附件的指令。
開啟 Developer Console，從 Debug 選單中選擇「Open Execute Anonymous Window」，貼上以下程式碼並執行。
當組織的儲存空間快滿時，我個人會使用這個指令。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">delete [select id from FeedItem];
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">delete [select id from FeedAttachment];
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">delete [select id from ContentDocument];
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">// 清空資源回收筒
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">database.emptyRecycleBin([select id from ContentDocument where IsDeleted = true ALL ROWS]);
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description></item><item><title>Salesforce推薦的Chrome擴充功能</title><link>http://kenji.blog/zh-tw/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/</link><pubDate>Mon, 02 May 2022 10:39:36 +0900</pubDate><guid>http://kenji.blog/zh-tw/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/</guid><description>&lt;img src="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img.png" alt="Featured image of post Salesforce推薦的Chrome擴充功能" />&lt;h3 id="salesforce-devtools">Salesforce DevTools
&lt;/h3>&lt;p>&lt;img src="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_1.png"
width="454"
height="361"
srcset="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_1_huf57bbbba5c728384e7ba6fa16d7a54c4_18951_480x0_resize_box_3.png 480w, http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_1_huf57bbbba5c728384e7ba6fa16d7a54c4_18951_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_1.png"
class="gallery-image"
data-flex-grow="125"
data-flex-basis="301px"
>&lt;/p>
&lt;p>&lt;img src="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_2.png"
width="448"
height="909"
srcset="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_2_huf368a70f31f9534fa7902adae2b30e6e_26924_480x0_resize_box_3.png 480w, http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_2_huf368a70f31f9534fa7902adae2b30e6e_26924_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img_2.png"
class="gallery-image"
data-flex-grow="49"
data-flex-basis="118px"
>&lt;/p>
&lt;p>您可以搜尋自訂欄位，或是一次大量匯出自訂物件的欄位。&lt;/p>
&lt;p>能夠當場建立 SOQL 也非常方便。&lt;/p>
&lt;p>&lt;a class="link" href="https://chrome.google.com/webstore/detail/salesforce-devtools/ehgmhinnhggigkogkbhnbodhbfjgncjf" target="_blank" rel="noopener"
>Salesforce DevTools&lt;/a>&lt;/p>
&lt;h3 id="salesforce-advanced-code-searcher">Salesforce advanced Code searcher
&lt;/h3>&lt;p>&lt;img src="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img.png"
width="257"
height="261"
srcset="http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_huc75a5c8c4d45e738551ca5afb26f380b_13227_480x0_resize_box_3.png 480w, http://kenji.blog/p/salesforce%E3%81%8A%E3%81%99%E3%81%99%E3%82%81chrome%E6%8B%A1%E5%BC%B5/img_huc75a5c8c4d45e738551ca5afb26f380b_13227_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img.png"
class="gallery-image"
data-flex-grow="98"
data-flex-basis="236px"
>&lt;/p>
&lt;p>這在搜尋 Salesforce 程式碼時非常方便。&lt;/p>
&lt;p>&lt;a class="link" href="https://chrome.google.com/webstore/detail/salesforce-advanced-code/lnkgcmpjkkkeffambkllliefdpjdklmi" target="_blank" rel="noopener"
>Salesforce advanced Code searcher&lt;/a>&lt;/p></description></item></channel></rss>