<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Meginfo Blog - Salesforce Partner]]></title><description><![CDATA[分享 Salesforce 知识，致力于打造中国最好的 Salesforce 技术博客]]></description><link>http://blog.meginfo.com.cn/</link><generator>Ghost 0.11</generator><lastBuildDate>Mon, 05 Jan 2026 12:03:44 GMT</lastBuildDate><atom:link href="http://blog.meginfo.com.cn/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[升级你的 Terminal，让 Salesforce 开发更高效]]></title><description><![CDATA[<p>Salesforce 开始主推 Salesforce DX 的开发模式之后，用到 Salesforce CLI 的频率也越来越高了。使用 sfdx cli 除了 <a href="https://forcedotcom.github.io/salesforcedx-vscode/">Salesforce Extensions for VS Code</a> 提供的 UI 封装之外，还有很多场景，需要在 Terminal 里直接执行相关命令。但 Mac 内置的 Terminal 并不是很好用，本篇给大家介绍一下，目前我在使用的一套方案，希望能帮助你提升生成效率。</p>

<h2 id="">亮点</h2>

<ul>
<li>Terminal 中的 sfdx cli 自动提示</li>
<li>Terminal 自定义主题</li>
<li>Terminal 中显示 Git Branch 名字</li>
<li>Terminal 支持历史命令搜索</li>
</ul>

<h2 id="homebrew">安装 Homebrew</h2>]]></description><link>http://blog.meginfo.com.cn/upgrade-your-terminal-for-salesforce-development/</link><guid isPermaLink="false">0f74e6ee-0446-47ee-b559-e0565404ef3e</guid><category><![CDATA[vs code]]></category><dc:creator><![CDATA[Jair Zheng]]></dc:creator><pubDate>Sun, 14 Jul 2019 07:01:46 GMT</pubDate><media:content url="http://blog.meginfo.com.cn/content/images/2019/07/15630875251257.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://blog.meginfo.com.cn/content/images/2019/07/15630875251257.jpg" alt="升级你的 Terminal，让 Salesforce 开发更高效"><p>Salesforce 开始主推 Salesforce DX 的开发模式之后，用到 Salesforce CLI 的频率也越来越高了。使用 sfdx cli 除了 <a href="https://forcedotcom.github.io/salesforcedx-vscode/">Salesforce Extensions for VS Code</a> 提供的 UI 封装之外，还有很多场景，需要在 Terminal 里直接执行相关命令。但 Mac 内置的 Terminal 并不是很好用，本篇给大家介绍一下，目前我在使用的一套方案，希望能帮助你提升生成效率。</p>

<h2 id="">亮点</h2>

<ul>
<li>Terminal 中的 sfdx cli 自动提示</li>
<li>Terminal 自定义主题</li>
<li>Terminal 中显示 Git Branch 名字</li>
<li>Terminal 支持历史命令搜索</li>
</ul>

<h2 id="homebrew">安装 Homebrew</h2>

<p><a href="https://brew.sh/">Homebrew</a> 是 macOS(or Linux) 的一款 package 的管理工具，大部分和开发相关的 package 都可以使用它来安装和升级。</p>

<p>复制下面这一行到 Terminal 中，回车确认进行安装。</p>

<pre><code class="language-bash">/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
</code></pre>

<blockquote>
  <p>Note: 安装 Homebrew 的时候会有一些依赖，在安装过程中会有提示，请仔细阅读具体的提示信息。</p>
</blockquote>

<h2 id="iterm2">安装 iTerm2</h2>

<p><a href="https://www.iterm2.com/">iTerm2</a> 相对于 macOS 内置的 Terminal，提供了很多新的特性，大部分的开发人员都选择了 iTerm2 作为主要的执行命令行工具。可以直接到 iTerm2 官网进行<a href="https://www.iterm2.com/downloads.html">下载安装</a>。可以顺便了解一下提供的<a href="https://www.iterm2.com/features.html">功能特性</a></p>

<h2 id="zsh">安装 ZSH</h2>

<p>Zsh 是一种以交互为目的设计的 shell script。macOS 内置了 Zsh，不过这里用 <strong>brew</strong> 重新安装，升级到最新版本。</p>

<pre><code class="language-bash">brew install zsh  
</code></pre>

<h2 id="ohmyzsh">安装 Oh My Zsh</h2>

<p><a href="https://github.com/robbyrussell/oh-my-zsh">Oh My Zsh</a> 是一个管理 Zsh 配置的开源项目，提供了丰富的插件、主题和配置。</p>

<p>安装方式</p>

<pre><code class="language-bash">$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
</code></pre>

<p>安装过程中会提示选择 <code>zsh</code> 作为默认的 shell script，选择 <code>Y</code>。安装成功之后，重启 iTerm2 查看效果。</p>

<h2 id="ohmyzsh">修改 Oh My Zsh 的默认主题</h2>

<p>Oh My Zsh 提供了丰富的主题，具体可以在<a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Themes">Github wiki 页面查看</a>，找到适合自己的主题。推荐我正在使用的 <a href="https://github.com/agnoster/agnoster-zsh-theme">agnoster</a>，主题提供：</p>

<ul>
<li><a href="https://ethanschoonover.com/solarized/">Solarized</a> 配色</li>
<li>Git 信息提示</li>
</ul>

<p>安装主题，需要修改 <code>~/.zshrc</code>，使用默认编辑器打开配置文件。</p>

<pre><code class="language-bash">open ~/.zshrc  
</code></pre>

<p>修改 ZSH_THEME 这一行</p>

<pre><code>ZSH_THEME="agnoster"  
</code></pre>

<p>在 Terminal 的路径中隐藏 “user@hostname”，并控制路径的长度，可以在 <code>~/.zshrc</code> 添加：</p>

<pre><code>prompt_context(){}

prompt_dir() {  
  prompt_segment blue black "%$(( $COLUMNS - 61 ))&lt;...&lt;%3~%&lt;&lt;"
}
</code></pre>

<p>设置后的效果和更多配置方式可以点击这里查看<a href="https://github.com/wesbos/Cobalt2-iterm/issues/15#issuecomment-224957918">Trim long paths in prompt</a></p>

<h2 id="">安装字体</h2>

<p>Oh My Zsh 的主题需要配合 <a href="https://github.com/powerline/fonts">powerline fonts</a>，才可以保证主题内容的完整显示。</p>

<p>使用下面方式安装</p>

<pre><code class="language-bash"># clone
git clone https://github.com/powerline/fonts.git --depth=1

# install
cd fonts  
./install.sh

# clean-up a bit
cd ..  
rm -rf fonts  
</code></pre>

<p>安装成功后，修改 iTerm 的默认字体 <code>iTerm2 &gt; Preferences &gt; Profiles &gt; Text &gt; Change Font.</code> </p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/07/15625000896823.jpg" alt="升级你的 Terminal，让 Salesforce 开发更高效"></p>

<p>字体可以选自己喜欢的，不过需要有 <code>for Powerline</code> 结尾的。</p>

<h2 id="iterm2">修改 iTerm2 的主题</h2>

<p><a href="https://iterm2colorschemes.com/">Iterm2-color-schemes</a> 在这个网站上下载主题包，然后安装下面方式启动主题：</p>

<p><code>iTerm2 &gt; Preferences &gt; Profile &gt; Colors &gt; Color Presets &gt; Import</code></p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/07/15630709159672.jpg" alt="升级你的 Terminal，让 Salesforce 开发更高效"></p>

<p>上面几步配置好，重启 Terminal，就可以拥有一个全新的 Terminal 了 🎉</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/07/15625003271577.jpg" alt="升级你的 Terminal，让 Salesforce 开发更高效"></p>

<h2 id="plugins">安装 Plugins</h2>

<p>Zsh 有丰富的插件，可以提供各种扩展，这里介绍几个插件：</p>

<h3 id="salesforceclizshcompletionhttpsgithubcomwadewegnersalesforceclizshcompletion"><a href="https://github.com/wadewegner/salesforce-cli-zsh-completion">salesforce-cli-zsh-completion</a></h3>

<p>Salesforce 团队成员写了一个 sfdx cli 的插件，可以实现自动提示，可以帮助我们在使用 sfdx cli 的时候快速找到需要的命令。</p>

<p>安装方式</p>

<pre><code class="language-bash">git clone https://github.com/wadewegner/salesforce-cli-zsh-completion.git ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/salesforce-cli-zsh-completion  
</code></pre>

<p>编辑 <code>~/.zshrc</code>，添加 <code>salesforce-cli-zsh-completion</code> 到 plugins 中</p>

<pre><code># ~/.zshrc
plugins=(salesforce-cli-zsh-completion)

source $ZSH/oh-my-zsh.sh

autoload -U compinit &amp;&amp; compinit  
</code></pre>

<p>执行下面的命令重新加载配置</p>

<pre><code class="language-bash">source ~/.zhrc  
</code></pre>

<p><code>cd</code> 到一个 sfdx cli 初始化的项目，然后输入 <code>sfdx</code>，点击两次 tab 键，就会有提示了，enjoy it！</p>

<h3 id="">推荐其他插件</h3>

<ul>
<li><a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a>: This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.</li>
<li><a href="https://github.com/zsh-users/zsh-autosuggestions">zsh-autosuggestions</a>: It suggests commands as you type based on history and completions.</li>
<li><a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#git">git</a>: Adds a lot of git aliases and functions for day-to-day git operations.</li>
</ul>

<p>插件安装配置好之后，<code>.zshrc</code> 文件中的 plugins:</p>

<pre><code>plugins=(  
  git
  salesforce-cli-zsh-completion
  zsh-autosuggestions
  zsh-syntax-highlighting
)
</code></pre>

<h2 id="">快捷键</h2>

<p>在命令行操作的时候，因为对光标的支持并不是很好，可以掌握一些基本的快捷键，帮助你快速的完成一些操作。</p>

<ul>
<li><code>Ctrl + a</code>: 移动到当前行的最前面</li>
<li><code>Ctrl + e</code>: 移动到当前行的最后面</li>
<li><code>Ctrl + r</code>: 搜索之前命令</li>
<li><code>Ctrl + w</code>: 删除光标前的单词</li>
<li>在 Tab 之间切换: <code>Cmd + →</code> 和 <code>Cmd + ←</code></li>
<li><code>Cmd + D</code> 打开一个新的 Pane</li>
<li>在 Pane 之间切换 <code>Cmd + ]</code> 和 <code>Cmd + [</code></li>
</ul>

<p>配置 iTerm 的全局切换 hotkey:</p>

<p><code>iTerm2 &gt; Preferences &gt; Keys &gt; Show/hide iTerm with a system-wide hotkey</code> 指定一个你想使用的一个快捷键，比如 <code>Ctrl + space</code>。</p>

<h2 id="aliases">别名 Aliases</h2>

<p>添加一些 alias 可以让你更方便的输入一些你常用的命名或者命令组合。配置方式很简单，只需要在 <code>.zshrc</code> 中添加就可以了。比如：</p>

<pre><code class="language-bash">alias sfpush="sfdx force:source:push --json --loglevel fatal"  
</code></pre>

<p>另外 <code>oh-my-zsh</code> 内置了很多 alias，比如 <a href="https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh">git alias</a></p>

<h2 id="vscode">VS Code 配置</h2>

<p>在 Settings 里加入下面两行，让上面的配置在 VS Code 的 Terminal 生效。</p>

<pre><code class="language-json">"terminal.integrated.fontFamily": "Source Code Pro for Powerline",
"terminal.integrated.shell.osx": "/bin/zsh"
</code></pre>

<h2 id="">参考</h2>

<ul>
<li><a href="https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/">How to Configure your macOs Terminal with Zsh like a Pro</a></li>
<li><a href="https://medium.com/@sahanarajasekar/5-ways-to-upgrade-your-terminal-2fb8ab447949">5 ways to upgrade your Terminal</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[迁移到 Salesforce Extensions for Visual Studio Code]]></title><description><![CDATA[<p>Salesforce 新推出的 IDE 经过不断的迭代升级之后，现在已经很成熟，所有现在完全可以从 Sublime 或者 Eclipse 迁移到 <a href="https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model">Salesforce Extensions for Visual Studio Code</a>。</p>

<h3 id="salesforceextensionsforvscode">安装 Salesforce Extensions for VS Code</h3>

<p>安装步骤可以参考官方文档 <a href="https://forcedotcom.github.io/salesforcedx-vscode/articles/getting-started/install">Install Salesforce Extensions for VS Code</a></p>

<h3 id="vscode">VS Code 的优势</h3>

<p>VS Code 的插件是官方在维护，这里列几点和其他 IDE 相比的优势：</p>

<ul>
<li>官方团队维护，更新速度快，不断会有新功能的推出</li>
<li>强大的智能提示</li>
<li>运行测试代码方便</li>
<li>支持所有 Salesforce 相关的开发，包括 Apex, VF, Aura</li></ul>]]></description><link>http://blog.meginfo.com.cn/migrate-to-salesforce-extensions-for-visual-studio-code/</link><guid isPermaLink="false">80a6d586-9a04-474c-8108-a212eed25d43</guid><category><![CDATA[Apex]]></category><category><![CDATA[vs code]]></category><dc:creator><![CDATA[Jair Zheng]]></dc:creator><pubDate>Mon, 22 Apr 2019 01:02:51 GMT</pubDate><content:encoded><![CDATA[<p>Salesforce 新推出的 IDE 经过不断的迭代升级之后，现在已经很成熟，所有现在完全可以从 Sublime 或者 Eclipse 迁移到 <a href="https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model">Salesforce Extensions for Visual Studio Code</a>。</p>

<h3 id="salesforceextensionsforvscode">安装 Salesforce Extensions for VS Code</h3>

<p>安装步骤可以参考官方文档 <a href="https://forcedotcom.github.io/salesforcedx-vscode/articles/getting-started/install">Install Salesforce Extensions for VS Code</a></p>

<h3 id="vscode">VS Code 的优势</h3>

<p>VS Code 的插件是官方在维护，这里列几点和其他 IDE 相比的优势：</p>

<ul>
<li>官方团队维护，更新速度快，不断会有新功能的推出</li>
<li>强大的智能提示</li>
<li>运行测试代码方便</li>
<li>支持所有 Salesforce 相关的开发，包括 Apex, VF, Aura 和 LWC</li>
<li>支持两种开发模式，Org Development 和 Package Development Model</li>
</ul>

<h3 id="">开发新项目</h3>

<p>如果是新项目，就可以直接使用 Salesforce 提供的文档进行开发就可以了，具体可以看这里：<a href="https://forcedotcom.github.io/salesforcedx-vscode">https://forcedotcom.github.io/salesforcedx-vscode</a></p>

<h3 id="">迁移旧项目</h3>

<p>很多现有项目，基本在使用 Sublime 或者 Eclipse 开发，这里提供一下具体的迁移步骤:</p>

<p>1 打开 VS Code，然后 打开 command palette (press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS) 运行 <strong>SFDX: Create Project with manifest</strong>，输入和旧项目相同的名字，然后找到原来项目的上级目录，回车确认，等待成功之后，会把原来的项目初始化成一个 VS Code 的项目。</p>

<p>2 更新 <strong>.gitignore</strong> 文件，忽略 VS Code 相关不需要提交的文件和文件夹。</p>

<pre><code># Ignore OS system files that are usually auto-added to directories
[Tt]humbs.db
.DS_Store

# Ignore Salesforce DX config files
.sfdx
.salesforce

# Ignore VSCode config files
.vscode
</code></pre>

<p>保存之后，git 提交一下。</p>

<p>3 执行下面的命令转化 Source format 并且保留 git 的提交历史。</p>

<pre><code class="language-bash">git config merge.renameLimit 999999  
sfdx force:mdapi:convert -r src -d src2  
rm -rf src  
mv src2 src  
git add -A  
git commit -m "Converted from metadata to source format"  
git config --unset merge.renameLimit # Return the git config option to the default  
</code></pre>

<p>4 打开 command palette 执行 <strong>SFDX: Authorize an Org</strong>，登陆一个 org，然后就可以正常开发了。</p>

<h2 id="references">References</h2>

<ul>
<li><a href="https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model">Org Development Model with VS Code</a></li>
<li><a href="https://ntotten.com/2018/05/11/convert-metadata-to-source-format-while-maintain-git-history/">Converting Salesforce Metadata to Source Format While Maintain Git History</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Debug Lightning Web Components]]></title><description><![CDATA[<h2 id="enabledebugmodel">Enable Debug Model</h2>

<p>LWC 的 JS code 默认是为了加载速度的提升，默认是 minified 的文件，不利于阅读和调试。所有在开发的时候，可以打开 <strong>Debug Mode</strong>。</p>

<p>To enable debug mode for users in your org:</p>

<ol>
<li>In Salesforce, from <strong>Setup</strong>, enter <strong>Debug Mode</strong> in the Quick Find box, then select <strong>Debug Mode Users</strong>.  </li>
<li>Enable the selection checkbox next to users for</li></ol>]]></description><link>http://blog.meginfo.com.cn/debug-lightning-web-components/</link><guid isPermaLink="false">5cec8d62-0141-4c97-a85b-7792430be391</guid><category><![CDATA[lwc]]></category><dc:creator><![CDATA[Jair Zheng]]></dc:creator><pubDate>Sun, 10 Mar 2019 14:59:35 GMT</pubDate><content:encoded><![CDATA[<h2 id="enabledebugmodel">Enable Debug Model</h2>

<p>LWC 的 JS code 默认是为了加载速度的提升，默认是 minified 的文件，不利于阅读和调试。所有在开发的时候，可以打开 <strong>Debug Mode</strong>。</p>

<p>To enable debug mode for users in your org:</p>

<ol>
<li>In Salesforce, from <strong>Setup</strong>, enter <strong>Debug Mode</strong> in the Quick Find box, then select <strong>Debug Mode Users</strong>.  </li>
<li>Enable the selection checkbox next to users for whom you want to enable debug mode.  </li>
<li>Click <strong>Enable</strong>.</li>
</ol>

<h2 id="debugusingchromedevtools">Debug Using Chrome DevTools</h2>

<p>开启 Debug Mode 之后，就可以使用 Chrome 的 DevTools 进行断点调试。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/03/15522253795992.jpg" alt=""></p>

<p>具体方式：</p>

<ol>
<li>打开包含要调试的 Component 页面，鼠标右键或者快捷键（Control-Shift-I or Option-Command-I) 打开 DevTools  </li>
<li>点击 Sources，在左侧目录找到对应的文件  </li>
<li>在中间部分，相应的 JS 行号上使用鼠标点击设置断点  </li>
<li>重新刷新页面，页面会停留在断点处，然后可以查看相关的信息</li>
</ol>

<h2 id="configchromedevtools">Config Chrome DevTools</h2>

<h3 id="blackboxjavascriptsourcefiles">Blackbox JavaScript Source Files</h3>

<p>在使用 Chrome DevTools 进行调试的时候，在一行一行查看你的代码的时候，有的时候会进入到你不想查看的代码中（比如 Salesforce 标准的 components 或者第三方库）。Chrome 提供了一个配置，可以屏蔽掉这些不想进入的 js 文件或者目录中。</p>

<h4 id="">屏蔽方式</h4>

<ol>
<li>在 Settings -> Blackboxing 加入下面的正则，屏蔽 Salesforce 标准库的 js 文件。</li>
</ol>

<pre><code>/aura_prod.*\.js$
\/components\/.*.js$
</code></pre>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/03/15522270209681.jpg" alt=""></p>

<ol>
<li>JS 源文件菜单</li>
</ol>

<p>在调试的过程中，可以在 js 文件上，点击右键，在菜单中选择 <strong>Blackbox script</strong> 里屏蔽当前文件。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/03/15522274057045.jpg" alt=""></p>

<h3 id="enablecustomformatters">Enable custom formatters</h3>

<p>DevTools 默认情况下没有启用 Custom Formatters，这样的话在调试的过程中，属性会显示成 Proxy，不方便阅读和调试。在 Settings -> Preferences 中选中 <strong>Enable custom formatters</strong>，就可以直接查看当前变量对应的值。</p>

<p>开启前：</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/03/15522289186810.jpg" alt=""></p>

<p>开启后：</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2019/03/Screen-Shot-2019-03-10-at-10.38.54-PM.png" alt="Screen Shot 2019-03-10 at 10.38.54 P"></p>

<h2 id="resources">Resources</h2>

<ul>
<li><a href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.debug_intro">Debug Lightning Web Components</a></li>
<li><a href="https://youtu.be/0B37nkNSVtg">Lightning Web Components: Debug Lightning Web Components</a></li>
<li><a href="https://developer.chrome.com/devtools/docs/blackboxing">Blackbox JavaScript Source Files</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[How to determine your org type via apex code]]></title><description><![CDATA[<p>Sometimes we want to use different values among production and sandboxes, one typical scenario is that we'd better use test endpoints instead of production endpoints because we don't want to mess up with the data in the production.</p>

<p>Here comes the question: how can we determine current org type in</p>]]></description><link>http://blog.meginfo.com.cn/determine-sandbox/</link><guid isPermaLink="false">417a7e1a-b09b-4ee3-a7ae-63bffc79412d</guid><category><![CDATA[sfdctips]]></category><category><![CDATA[Salesforce]]></category><dc:creator><![CDATA[Adam Wu]]></dc:creator><pubDate>Wed, 20 Jun 2018 14:45:43 GMT</pubDate><content:encoded><![CDATA[<p>Sometimes we want to use different values among production and sandboxes, one typical scenario is that we'd better use test endpoints instead of production endpoints because we don't want to mess up with the data in the production.</p>

<p>Here comes the question: how can we determine current org type in the apex code?</p>

<p>After Summer 14', the Organization object has a new read-only field: <code>IsSandbox</code></p>

<p><a href="http://releasenotes.docs.salesforce.com/en-us/summer14/release-notes/rn_api_objects_changed.htm">release note</a></p>

<p>We can take advantage of that field to achieve our goal.</p>

<pre><code class="language-Apex">public class Utility  
{
    public static Boolean isSandbox
    {
        get
        {
            return [select IsSandbox from Organization limit 1].IsSandbox;
        }
    }

    public static String ServiceEndpoint
    {
        get
        {
            if(isSandbox)
            {
                return 'https://test.api.com';
            }
            else
            {
                return 'https://production.api.com';
            }
        }
    }
}
</code></pre>

<p>We can use <code>Utility.isSandbox</code> to determine current org type, use <code>Utility.ServiceEndpoint</code> to get the service endpoint in both production and sandbox.</p>]]></content:encoded></item><item><title><![CDATA[Add Close Case button in Lightning]]></title><description><![CDATA[<p>The close case button is very useful and handy when we want to close a case.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Close-Case-Button.png" alt=""></p>

<p>We don't need to provide much information to close a case.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Close-Case-.png" alt=""></p>

<p>The case is closed quickly with a related case comment created.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Case-Closed.png" alt=""></p>

<p>But at this very moment, Salesforce does not have a close case</p>]]></description><link>http://blog.meginfo.com.cn/lightning-close-case/</link><guid isPermaLink="false">4cca7940-e0f9-475d-b835-3d4ca653ef23</guid><category><![CDATA[sfdctips]]></category><category><![CDATA[Salesforce]]></category><dc:creator><![CDATA[Adam Wu]]></dc:creator><pubDate>Tue, 19 Jun 2018 15:58:01 GMT</pubDate><media:content url="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case2.png" medium="image"/><content:encoded><![CDATA[<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case2.png" alt="Add Close Case button in Lightning"><p>The close case button is very useful and handy when we want to close a case.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Close-Case-Button.png" alt="Add Close Case button in Lightning"></p>

<p>We don't need to provide much information to close a case.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Close-Case-.png" alt="Add Close Case button in Lightning"></p>

<p>The case is closed quickly with a related case comment created.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Classic-Case-Closed.png" alt="Add Close Case button in Lightning"></p>

<p>But at this very moment, Salesforce does not have a close case button in Lightning yet.</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case-3.png" alt="Add Close Case button in Lightning"></p>

<p>You can vote for the idea here: <a href="https://success.salesforce.com/ideaView?id=0873A000000cMWbQAM">https://success.salesforce.com/ideaView?id=0873A000000cMWbQAM</a></p>

<hr>

<h3 id="addaclosecasebuttoninlightning">Add a Close Case button in Lightning</h3>

<p>If you want the close case function in Lightning now, we can create an action and add it to the case page layout.</p>

<ol>
<li><p>Go to <code>Setup</code> -> <code>Object Manager</code> -> <code>Case object</code> -> <code>Button, Links, and Actions</code> -> Click <code>New Action</code> <br>
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-New-Case-Action.png" alt="Add Close Case button in Lightning" title=""></p></li>
<li><p>For <em>Action Type</em>, select <code>Update a Record</code>, <br>
For <em>Standard Label Type</em>, select <code>--None--</code>, <br>
For <em>Label</em>, enter Close Case.
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case-Action.png" alt="Add Close Case button in Lightning" title=""></p></li>
<li><p>After clicking the <strong>Save</strong> button, create a <em>Predefined Field Value</em> and select <code>Closed</code> <br>
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case-Action-Predefined-Value.png" alt="Add Close Case button in Lightning" title=""></p></li>
<li><p>Edit the action page layout and drag the <strong>Internal Comments</strong> field to the page, remove the other fields and click <strong>Save</strong>. <br>
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Close-Case-Page-Layout.png" alt="Add Close Case button in Lightning" title=""></p></li>
<li><p>Edit Case Page Layouts, drag the new quick action to the <strong>Salesforce Mobile and Lightning Experience Actions</strong> section, and Save.</p></li>
<li><p>Go to the case page and we can see the Close Case action. <br>
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Cloase-Case-Comment.png" alt="Add Close Case button in Lightning" title=""></p></li>
</ol>

<p>Now we can use the <strong>Close Case</strong> function in Lightning without writing any code, isn't that cool? <br>
<img src="http://blog.meginfo.com.cn/content/images/2018/06/Lightning-Case-Closed.png" alt="Add Close Case button in Lightning"></p>]]></content:encoded></item><item><title><![CDATA[How to add a Lightning Component to a Visualforce page]]></title><description><![CDATA[A quick intro to Salesforce Lightning Out. This post will show you how to add a Lightning Component to a Visualforce page using Lightning Out.]]></description><link>http://blog.meginfo.com.cn/lightning-out/</link><guid isPermaLink="false">43fb9fb6-9fec-499f-aae1-50c8792b416d</guid><category><![CDATA[sfdctips]]></category><category><![CDATA[Salesforce]]></category><dc:creator><![CDATA[Adam Wu]]></dc:creator><pubDate>Mon, 18 Jun 2018 15:56:00 GMT</pubDate><content:encoded><![CDATA[<blockquote>
  <p>Lightning Out is a technology where one can take Lightning components built on the Force.com platform to the external applications like Sharepoint, SAP, Node apps on Heroku and many others.</p>
</blockquote>

<p>In this post we will show you how to add a Lightning Component to a Visualforce page using Lightning Out.</p>

<hr>

<h6 id="1createalightningcomponent">1. Create a Lightning Component</h6>

<p><code>helloLightning.cmp</code></p>

<pre><code class="language-JavaScript">&lt;aura:component &gt;

  &lt;aura:attribute name="messages" type="List" /&gt;

  &lt;aura:iteration items="{!v.messages}" var="msg"&gt;
    &lt;p&gt;{!msg}&lt;/p&gt;
  &lt;/aura:iteration&gt;

&lt;/aura:component&gt;  
</code></pre>

<p>This component has a list type of attribute named "messages", which will be iterated on page.</p>

<hr>

<h6 id="2createalightningapp">2. Create a Lightning app</h6>

<p>The App must extends the <code>ltng:outApp</code> and reference the Lightning Component we just created. <br>
(If you don’t want SLDS resources added to the page, extend from <code>ltng:outAppUnstyled</code> instead)</p>

<p><code>LightningOutDemo.app</code></p>

<pre><code class="language-JavaScript">&lt;aura:application access="GLOBAL" extends="ltng:outApp"&gt;  
  &lt;aura:dependency resource="helloLightning"/&gt;
&lt;/aura:application&gt;  
</code></pre>

<hr>

<h6 id="3addthelightningcomponentsforvisualforcejavascriptlibrary">3. Add the Lightning Components for Visualforce JavaScript Library</h6>

<p>Add <code>&lt;apex:includeLightning /&gt;</code> at the beginning of your page. <br>
This component loads the JavaScript file used by Lightning Components for Visualforce.</p>

<p><code>sample.vfp</code></p>

<pre><code class="language-JavaScript">&lt;apex:page&gt;  
  &lt;apex:includeLightning/&gt;
  ...
  ...
&lt;/apex:page&gt;  
</code></pre>

<hr>

<h6 id="4referencetheappandcreateacomponentonapage">4. Reference the app and Create a Component on a Page</h6>

<p>To reference this app on your page, use <code>$Lightning.use("theNamespace:appName", function() {});</code> <br>
because the app is defined in your org (that is, not in a managed package), you can use the default “c” namespace instead;</p>

<p>To add your component to the page, use <code>$Lightning.createComponent(String type, Object attributes, String locator, function callback);</code>, <br>
we can pass some values to the component using the <code>attributes</code> parameter, <br>
this function includes a <code>domLocator</code> parameter which specifies the DOM element where you want the component inserted.</p>

<pre><code class="language-JavaScript">&lt;apex:page&gt;  
  &lt;apex:includeLightning /&gt;

  &lt;div&gt;Visualforce&lt;/div&gt;

  &lt;div id="lightningLocator"&gt;
    &lt;!-- Lightning Component will be added here --&gt;
  &lt;/div&gt;

  &lt;div&gt;Visualforce&lt;/div&gt;

  &lt;script&gt;
  $Lightning.use("c:LightningOutDemo", function() {
    $Lightning.createComponent("c:helloLightning",                          
                               { messages : ['Lightning Out', 'Is', 'Cool'] },
                               "lightningLocator", // domLocator                                                             
                               function(cmp) {
                                 console.log( 'Lightning Out Loaded.' );      
                               });
  });
  &lt;/script&gt;
&lt;/apex:page&gt;  
</code></pre>

<hr>

<h6 id="5result">5. Result</h6>

<p>We can see the lightning component has been added inside the <code>lightningLocator</code>  </p>

<h2 id="imgsrccontentimages201806result5pngaltresult"><img src="http://blog.meginfo.com.cn/content/images/2018/06/Result-5.png" alt="result"></h2>

<h6 id="6displaycomponentsdynamically">6. Display components dynamically</h6>

<p>We can also display our Lightning Component only in Lightning Experience.</p>

<pre><code class="language-JavaScript">&lt;apex:page&gt;  
  &lt;apex:includeLightning /&gt;

  &lt;apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme4d' }"&gt;

    &lt;div id="lightningLocator"&gt;&lt;/div&gt;

    &lt;script&gt;
    $Lightning.use("c:LightningOutDemo", function() {
      $Lightning.createComponent("c:helloLightning",                          
                                 { messages : ['Lightning Out', 'Is', 'Cool'] },
                                 "lightningLocator", // domLocator                                                             
                                 function(cmp) {
                                   console.log( 'Lightning Out Loaded.' );      
                                 });
    });
    &lt;/script&gt;
  &lt;/apex:outputPanel&gt;

  &lt;apex:outputPanel rendered="{! $User.UIThemeDisplayed != 'Theme4d' }"&gt;
    &lt;!-- Classic VF code --&gt;
  &lt;/apex:outputPanel&gt;
&lt;/apex:page&gt;  
</code></pre>

<h4 id="moreinfo">More Info</h4>

<p><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_markup.htm#lightning_out_markup">Lightning Out Markup</a></p>

<p><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_requirements.htm">Lightning Out Requirements</a></p>

<p><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_out_considerations.htm">Lightning Out Considerations and Limitations</a></p>

<p><a href="https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_useruitheme.htm">$User.UITheme and $User.UIThemeDisplayed</a></p>]]></content:encoded></item><item><title><![CDATA[关于 Task Actions 的介绍]]></title><description><![CDATA[<p>在 Salesforce 中 Tasks 是一个强大的工具，可以帮助你跟踪你的工作并关闭交易。在 Salesforce 的 CRM 对象中扮演着重要的角色，可以将 Task 与 Opportunity、Lead、Account、以及 Contact 关联，并且在这些对象上管理相应的 Tasks。在一个 Automate Process 中，Task Actions 决定了一个 Task 被分派给一指定的人的详细信息，一个 Automate Process 可以是 Workflow rules，Approval processes，或者 Entitlement processes。</p>

<h2 id="workflowtask">创建 Workflow Task</h2>

<ul>
<li><p>Setup > Create > Workflow &amp; Approvals</p></li></ul>]]></description><link>http://blog.meginfo.com.cn/about-task-actions/</link><guid isPermaLink="false">c798ae7f-8283-401e-b119-10586a3936cd</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[sfdctips]]></category><category><![CDATA[admin]]></category><dc:creator><![CDATA[Beck Wu]]></dc:creator><pubDate>Tue, 27 Sep 2016 03:13:39 GMT</pubDate><content:encoded><![CDATA[<p>在 Salesforce 中 Tasks 是一个强大的工具，可以帮助你跟踪你的工作并关闭交易。在 Salesforce 的 CRM 对象中扮演着重要的角色，可以将 Task 与 Opportunity、Lead、Account、以及 Contact 关联，并且在这些对象上管理相应的 Tasks。在一个 Automate Process 中，Task Actions 决定了一个 Task 被分派给一指定的人的详细信息，一个 Automate Process 可以是 Workflow rules，Approval processes，或者 Entitlement processes。</p>

<h2 id="workflowtask">创建 Workflow Task</h2>

<ul>
<li><p>Setup > Create > Workflow &amp; Approvals > Tasks > New Task</p></li>
<li><p>为 Task 选择一个 Object，然后 Next
<img src="http://blog.meginfo.com.cn/content/images/2016/07/Screen-Shot-2016-07-03-at-4-37-31-PM-1.png" alt=""></p></li>
<li><p>接下来用 Task 的 Field 值设置你的 Task
<img src="http://blog.meginfo.com.cn/content/images/2016/07/Screen-Shot-2016-07-03-at-4-37-56-PM.png" alt=""></p></li>
</ul>

<h2 id="task">Task 的具体设置</h2>

<ul>
<li><strong>Object</strong> <br>
给 Task 选择一个关联的对象，Task 中设置的 Object 要和你创建的相应的 Workflow Rule 或 Approval process 是同一个 Object。</li>
<li><strong>Assigned To</strong> <br>
选择你想要把这个 Task 分配给谁，可以是一个 User，Role，Record Owner，Record Creator，Opportunity Team Role，或者 Account Team Role，具体的要看你选择的 Object 的类型。
<ul><li>如果 Task 的 Assigned To 值被设置为一个 Lead 或者 Case 的 Record Owner 并且 Record Owner 是在一个 Queue 中，那么 Task 将会分派给触发 Rule 的那个人。</li>
<li>如果一个 Custom Object 有一个关联到一个Standard Object的 Master-Detail Relationship，这个 Custom Object 的 Owner 会被自动设置为 Master Standard Object 的 Owner。</li>
<li>如果一个 Workflow Task 的 Assigned To 值是一个 Role，并且在那个 Role 中不止一个 User 或者没有一个 User，那么就会忽略 Role 的值， Record Owner 会作为 Task 的 Assignee。建议不要把一个 Task 分派给一个 有多个 User 的 Role，把一个 Task 分派给一个只有一个 User 的 Role 可以让你容易的通过 Role 改变 User，不用去修改 Workflow Rule。</li>
<li>如果一个 Lead 被一个不是这个 Lead Owner的 User 转变了，所有关联到这个 Lead 的 Workflow Tasks 会被分派给那个 User，而 Email Alerts 会被分派给 Lead Owner。</li></ul></li>
<li><strong>Subject</strong> <br>
Task 的主题，设置值得时候建议把自动生成的 Tasks 与用户创建的 Tasks 区分开，可以通过加入特殊的注释，例如在自动生成的 Task Subject 中加入（Automated）注释。  </li>
<li><strong>Unique Name</strong> <br>
Task Component 的 Api 名字，要求在同一个 Object 下的所有 Tasks 要有唯一的 Api 名字，不同的 Object 下的 Tasks 可以有相同的 Api 名字。  </li>
<li><strong>Due Date</strong> <br>
Task 的到期日期，Due Date 的时间区（Time Zone）依赖 Assignee 的 Time Zone。可以根据 Workflow 触发的时间设置 Workflow Task 的 Due Date，例如设置 Task Due Date 为 <code>Rule Trigger Date plus 5 days</code>。  </li>
<li><strong>Created By</strong> <br>
如果一个 Task 记录在一个 Workflow Rule 被触发的时候创建，那么这个 Task 记录的 Created By 值就是触发 Rule 的那个人。</li>
<li><strong>Status</strong></li>
<li><strong>Priority</strong></li>
<li><strong>Comments</strong></li>
</ul>

<h2 id="lightningexperiencesalesforceclassictask">Lightning Experience 和 Salesforce Classic 中 Task 的使用</h2>

<h3 id="lightningexperiencetask">在 Lightning Experience 中使用 Task</h3>

<ul>
<li><strong>在一个时间 Tasks 只可以有一个 Owner</strong> <br>
一个 Task 只能被一个人拥有，如果你重新分派一个 Task 给其他人，那么这个 Task 将不会再出现在你的 Task List 中，除非那个人在 Role Hierarchy 中的位置低于你，这样你可以在你的 Delegated View List View 中看到这个 Task。</li>
<li><strong>管理员不可以修改其他人的 Tasks</strong> <br>
任何人都可以重新把 Task 分派给另外一个人，在 Role Hierarchy 中，管理员可以看到分派给层级结构一下的 Tasks，但是不可以修改它们。</li>
<li><strong>没有 Recurring Tasks</strong> <br>
在 Lightning Experience 中，你不可以创建一个 Recurring Tasks。</li>
<li><strong>Task Assignments 邮件通知 Limitations 限制</strong> <br>
在 Lightning Experience 中，当你分派一个 Task 的时候是没有 <code>send an email</code> 选项的，也不可以让你设置当别人分派给你任务时接收一个邮件，相对的这些设置在 Salesforce Classic 中是可以有的。</li>
<li><strong>没有 Task Reminders</strong></li>
</ul>

<h3 id="salesforceclassictask">在 Salesforce Classic 中使用 Task</h3>

<ul>
<li><strong>有 Recurring Tasks</strong> <br>
Recurring Tasks 只能用默认的 Record Type，如果你应用一个不是默认的 Record Type， Salesforce 仍然会把默认的 Record Type 应用到 Recurring Tasks。但是 Salesforce 不会显示默认的 Record Type 相关联的 Picklist Fields。还有 Due Date 在 Recurring Tasks 中是无效的。  </li>
<li><strong>Task 关联多个 Contacts</strong> <br>
在 Name Field 中，你可以最多将50个 Contacts 与一个 Task 关联，但是只能关联一个 Lead。不可以将多个 Contacts 与 Recurring Tasks 关联或者将一个 Task 分派给多个 Users。</li>
<li><strong>Assigning Tasks</strong> <br>
默认情况下，一个 Task 会被 assign 给 Task 的创建人。同时在创建一个 Task 的时候可以选择将多个同样的 Task 分派给多个人(在打开的 Search 框中点击 <code>Multiple Users</code> tab)。</li>
<li><strong>新的 Task 的 Email Notifications</strong> <br>
根据你的 Salesforce Org 的配置情况，你可以选择 Task 的 Email 通知的发送方式。 <br>
如果每个 Task 分派给你的时候都会自动的收到一个邮件，你可以选择关闭自动发送方式：<code>Personal Settings</code>  >  <code>Reminders &amp; Alerts</code>  >  不勾选 <code>Email me when someone assigns me a task</code>。如果你不勾选，就不会自动发邮件，但可以选择在创建一个 Task 的页面勾选 <code>Send Email Notification</code> 进行发邮件。Salesforce1 有一个单独的设置，可以通过你的 Mobile Device 接收 Task 的邮件通知。</li>
<li><strong>Task 在 Chatter 中的应用</strong> <br>
如果一个新的 Task 被关联到一个记录中 (Account), 那么这个 Task 就会出现在这个记录的 Feed 中。对于你 Follow 的任何类型的记录，你都可以在 Feed 中看到所有的 Tasks，不管这个 Task 是由谁创建的。 <br>
Salesforce Admin 可以指定你是否可以为一个类型的记录在相应得 Chatter Feed 中创建一个新的 Task。例如，你有权限访问一个 Account 记录，但是你只可以在这个 Account 的 Feed 中看到 Tasks，不能创建新的 Task。 <br>
Recurring Tasks 不可以在 Chatter Feed 中显示，你也不可以在 Chatter 中 follow Recurring Tasks。</li>
</ul>

<h2 id="">总结</h2>

<p>Salesforce 中 Task 对象带来了很多便利的功能，在开发的过程中也会经常遇到， 但在开发和使用的过程中也有一些需要注意的地方，希望本文能给大家带来一定的帮助，还希望能够和大家多多交流。</p>]]></content:encoded></item><item><title><![CDATA[怎样把一个参数从 Visualforce Page 传递到 Apex Method]]></title><description><![CDATA[<p>对于刚进入 Salesforce 开发人员来讲，他们会遇到这样一个问题，就是<strong>"怎样把一个参数从 Visualforce Page 传递到 Controller 中?"</strong>。</p>

<p>例如，下面这个代码，在这个页面上根据一个 Account 最多能显示10条 Contact 记录。</p>

<pre><code class="language-html">&lt;apex:page standardController="Account" extensions="AccountController"&gt;  
  &lt;apex:outputPanel id="all"&gt;
    &lt;apex:form&gt;
      &lt;apex:pageBlock title="Account Detail"&gt;
        &lt;apex:pageBlockSection title="Account"&gt;
          &lt;</code></pre>]]></description><link>http://blog.meginfo.com.cn/how-can-i-pass-a-parameter-to-a-controller-method/</link><guid isPermaLink="false">b6f6d213-836b-4ae4-86cf-014759034e8f</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[Apex]]></category><category><![CDATA[sfdctips]]></category><dc:creator><![CDATA[Samba]]></dc:creator><pubDate>Mon, 19 Sep 2016 06:31:09 GMT</pubDate><content:encoded><![CDATA[<p>对于刚进入 Salesforce 开发人员来讲，他们会遇到这样一个问题，就是<strong>"怎样把一个参数从 Visualforce Page 传递到 Controller 中?"</strong>。</p>

<p>例如，下面这个代码，在这个页面上根据一个 Account 最多能显示10条 Contact 记录。</p>

<pre><code class="language-html">&lt;apex:page standardController="Account" extensions="AccountController"&gt;  
  &lt;apex:outputPanel id="all"&gt;
    &lt;apex:form&gt;
      &lt;apex:pageBlock title="Account Detail"&gt;
        &lt;apex:pageBlockSection title="Account"&gt;
          &lt;apex:outputField value="{!Account.Name}"/&gt;
          &lt;apex:outputField value="{!Account.Description}"/&gt;
        &lt;/apex:pageBlockSection&gt;
        &lt;apex:pageBlockSection title="Contacts" columns="1"&gt;
          &lt;apex:pageBlockTable value="{!Conts}" var="cont" rows="10"&gt;
          &lt;apex:column value="{!cont.Id}"/&gt;
          &lt;apex:column value="{!cont.Name}"/&gt;
          &lt;apex:column value="{!cont.Email}"/&gt;
          &lt;apex:column value="{!cont.Phone}"/&gt;
        &lt;/apex:pageBlockTable&gt;
      &lt;/apex:pageBlockSection&gt;
      &lt;/apex:pageBlock&gt;
    &lt;/apex:form&gt;
  &lt;/apex:outputPanel&gt;
&lt;/apex:page&gt;  
</code></pre>

<p>接下来是上面页面对应的 Controller。</p>

<pre><code class="language-java">public class AccountController  
{
    private ApexPages.StandardController stdCtrl;

    public AccountController(ApexPages.StandardController std)
    {
        stdCtrl = std;
        setupContacts();
    }

    public List&lt;Contact&gt; Conts {get; set;}

    private void setupContacts()
    {
        conts=[select id, Name, Email, Phone from Contact where AccountId = :stdCtrl.getId()];
    }
}
</code></pre>

<p>页面展示如下。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/1-3.png" width="700px"></p>

<p>现在，我们需要为 Contacts 列表中的每一条记录在左边添加一个 Del 操作。为了能够区分具体要删掉的是哪一条 Contact, 我们需要把 Contact 的 Id 以参数的形式传递到后台的 <code>delCont</code> 方法中。我猜想很多人第一次为把它写成如下。</p>

<pre><code class="language-html">&lt;apex:column headerValue="Action"&gt;  
   &lt;apex:commandButton value="Del" action="{!delCont(cont.Id)}"/&gt;
&lt;/apex:column&gt;  
</code></pre>

<p>然而，在保存编译代码的时候，会得到的不知道该方法的错误。哪么，如何将该参数传递过去呢？<apex:param> 是一个标准的组件，允许将参数传递到 Controller 中的一个属性。</apex:param></p>

<pre><code class="language-html">&lt;apex:commandButton value="Del" action="{!delCont}" rerender="all"&gt;  
   &lt;apex:param name="contIdParam" value="{!cont.id}" assignTo="{!ContIdChosen}"/&gt;
&lt;/apex:commandButton&gt;  
</code></pre>

<p>添加 ContIdChosen 属性到 Controller 中。</p>

<pre><code class="language-java">public String ContIdChosen {get; set;}  
</code></pre>

<p>当 Del button 被单击后，Cont.id 会先赋值给 ContIdChosen。然后再执行 delCont 方法。</p>

<pre><code class="language-java">public void delCont()  
{
    Contact toDel = new Contact(id = ContIdChosen);
    delete todel;

    setupContacts();
}
</code></pre>

<p>为了在 Del button 单击后能及时的在页面上看到效果，我在 Del button 中加了 rerender 操作，一旦 Del 方法在后台执行完成后，页面上会自动的移除被删除的记录。</p>

<h2 id="">结语</h2>

<p>更多 Salesforce 学习资料将在后续推出，敬请关注。如果有什么问题可以发送到我的邮箱：samba.gao@meginfo.com。</p>]]></content:encoded></item><item><title><![CDATA[Salesforce 中 Package 的使用说明]]></title><description><![CDATA[<h2 id="package">为什么要创建一个 Package</h2>

<ol>
<li>如果我们经常在不同的 Org 中遇到相同的需求，哪么我们可以开发出一个 Package 出来，然后这个 Package 便可以安装到任意一个 Org 中，节省了重复开发的时间。  </li>
<li>我们也可以开发一个收费的 Package 并上传到 AppExchange 中，当有人使用你的 Package 时，你便可以获得一定的利润。  </li>
<li>另外在 Performance Edition Org 中，对开发有很多的限制。为了满足客户的需求，我们可以在 Developer Org 中创建一个 Managed Package, 然后安装它到 Performance Edition 中。</li>
</ol>

<h2 id="developereditionorg">申请 Developer Edition Org</h2>

<p>首先为了创建一个 Package, 我们需要准备一个 Developer Org。如果你还没有一个</p>]]></description><link>http://blog.meginfo.com.cn/how-to-use-package-in-salesforce/</link><guid isPermaLink="false">e4599e59-bf45-406c-a70f-8c95c11b8458</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[admin]]></category><dc:creator><![CDATA[Samba]]></dc:creator><pubDate>Sun, 24 Jul 2016 14:02:05 GMT</pubDate><content:encoded><![CDATA[<h2 id="package">为什么要创建一个 Package</h2>

<ol>
<li>如果我们经常在不同的 Org 中遇到相同的需求，哪么我们可以开发出一个 Package 出来，然后这个 Package 便可以安装到任意一个 Org 中，节省了重复开发的时间。  </li>
<li>我们也可以开发一个收费的 Package 并上传到 AppExchange 中，当有人使用你的 Package 时，你便可以获得一定的利润。  </li>
<li>另外在 Performance Edition Org 中，对开发有很多的限制。为了满足客户的需求，我们可以在 Developer Org 中创建一个 Managed Package, 然后安装它到 Performance Edition 中。</li>
</ol>

<h2 id="developereditionorg">申请 Developer Edition Org</h2>

<p>首先为了创建一个 Package, 我们需要准备一个 Developer Org。如果你还没有一个 Developer Org, 哪么请到这里 <a href="https://developer.salesforce.com/signup">https://developer.salesforce.com/signup</a> 先注册一个开发者账号。</p>

<h2 id="package">创建 Package</h2>

<p>单击 <code>Setup -&gt; Build -&gt; Create -&gt; Packages</code>, 为你的 Package 创建一个合适的名字。单击 Add button, 把你准备好的组件添加进来。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/1-2.png" width="700px"></p>

<h2 id="unmanagedmanagedpackages">Unmanaged 和 Managed Packages</h2>

<p>Package 有两种类型，一种是 Unmanaged Package, 另一种是 Managed Package。</p>

<p><strong>Unmanaged Package:</strong> 默认情况下 Package 是 Unmanaged Package, 这种 Package 不能升级, 但是在安装完后可以在 Org 中对这个 Package 里的组件进行修改。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/2.png" width="700px"></p>

<p><strong>Managed Package:</strong> 在 Developer Settings 中单击 Edit button。之后在 Register a namespace prefix 里需要填写一个 Package 前缀。在 Choose the package you want managed 里选择一个你想要 Managed 的 Package, 这里选择 Test Package。单击 Review My Selections button。另外，Managed Package 安装到 Org 中后，组件不允许修改，但是可以对 Managed Package 进行升级。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/3.png" width="700px"> <br>
<img src="http://blog.meginfo.com.cn/content/images/2016/06/4.png" width="700px"> <br>
<img src="http://blog.meginfo.com.cn/content/images/2016/06/5.png" width="700px"></p>

<h2 id="package">上传你的 Package!</h2>

<p>在 Package 页面上单击 Upload button。输入当前 Package 的版本名字和版本号。</p>

<p><strong>Release Type:</strong> 如果选择 Managed - Released 后，说明已经准备正式要发布到 Force.com AppExchange。一旦发布后，你将不能在编辑一些属性。而 Managed - Beta, 则是在正式发布前可以做一些测试。</p>

<p><strong>Release Notes:</strong>
如果你想添加一个 Package 的使用说明，可以设置 URL 关联到它。</p>

<p><strong>Post Install Instructions:</strong>
当 Package 安装后，你想跳转到的链接地址。</p>

<p><strong>Password (Optional):</strong>
如果想在安装 Package 的时候输入密码，哪么可以在这里设置你想要的密码。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/6.png" width="700px"> <br>
单击 Upload button.
<img src="http://blog.meginfo.com.cn/content/images/2016/06/7.png" width="700px"></p>

<h2 id="package">安装Package</h2>

<p>在上图中的 Version Detail 中你能看到 Installation URL field，这是一个安装的 URL, 可以把它安装到 Production, Developer Edition, etc。如果想把它安装到 Sandbox, 需要把域名中的 login 改成 test。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/8.png" width="700px"></p>

<h2 id="">结语</h2>

<p>如果想要了解更多如何将 Package 发布到 AppExchange， 可以参考这个链接: <a href="https://developer.salesforce.com/page/Security_Review。">https://developer.salesforce.com/page/Security_Review。</a>
更多 Salesforce 学习资料将在后续推出，敬请关注。如果有什么问题可以发送到我的邮箱：samba.gao@meginfo.com。</p>]]></content:encoded></item><item><title><![CDATA[Salesforce Platform Developer 1 认证考试]]></title><description><![CDATA[<p>Dev I 中的内容涉及 SF 平台的内容以及程序开发技术知识，在准备考试之前最好有一定的 Force.com Platform 平台实践和相关程序开发的经验基础，这样的话在做准备的时候就可以事半功倍。接下来会在这篇文章中分各个模块向大家介绍一些在准备的时候一些额外的提示和总结。考试的问题中有好多都是给你设置某个场景然后去选择答案，60-70%的问题都是一些基础的场景，所以你应该清楚的理解每个模块的内容，还有在考试的时候有些题会给你一定的迷惑性，对于这样的题你需要做的是一定要多读几遍，这样你会很容易发现这道题的真正意图。</p>

<blockquote>
  <p>每个模块中有一些链接会链接到 Salesforce Trailhead、 Apex Developer Guide、 Visualforce Developer Guide 等，链接的这些内容都是比较实时的文档，涵盖 Salesforce Release 的最新内容。另外在这些链接中可以进行相应的扩展，如果你对哪个模块不够清楚可以针对性的了解。</p>
</blockquote>

<h2 id="">模块和战略</h2>

<p>首先，认真阅读 <a href="http://certification.salesforce.com/platform-developers">Platform developer 1 Certification study guide</a>，尤其是里面的 Exam Outline 最好多读几遍，真正明白整个考试所涉及的内容，</p>]]></description><link>http://blog.meginfo.com.cn/salesforce-developer-1-certificaiton/</link><guid isPermaLink="false">f68a8eb0-29c5-4d66-82dc-10387cb8b00f</guid><category><![CDATA[Apex]]></category><category><![CDATA[Certification]]></category><dc:creator><![CDATA[Beck Wu]]></dc:creator><pubDate>Mon, 11 Jul 2016 03:10:41 GMT</pubDate><content:encoded><![CDATA[<p>Dev I 中的内容涉及 SF 平台的内容以及程序开发技术知识，在准备考试之前最好有一定的 Force.com Platform 平台实践和相关程序开发的经验基础，这样的话在做准备的时候就可以事半功倍。接下来会在这篇文章中分各个模块向大家介绍一些在准备的时候一些额外的提示和总结。考试的问题中有好多都是给你设置某个场景然后去选择答案，60-70%的问题都是一些基础的场景，所以你应该清楚的理解每个模块的内容，还有在考试的时候有些题会给你一定的迷惑性，对于这样的题你需要做的是一定要多读几遍，这样你会很容易发现这道题的真正意图。</p>

<blockquote>
  <p>每个模块中有一些链接会链接到 Salesforce Trailhead、 Apex Developer Guide、 Visualforce Developer Guide 等，链接的这些内容都是比较实时的文档，涵盖 Salesforce Release 的最新内容。另外在这些链接中可以进行相应的扩展，如果你对哪个模块不够清楚可以针对性的了解。</p>
</blockquote>

<h2 id="">模块和战略</h2>

<p>首先，认真阅读 <a href="http://certification.salesforce.com/platform-developers">Platform developer 1 Certification study guide</a>，尤其是里面的 Exam Outline 最好多读几遍，真正明白整个考试所涉及的内容，同时明白你哪些内容还不够充分，还需要更多的学习。有可能你的 Salesforce 经验很多，有些方面的内容没有涉及到，或者需要回顾一下，清楚一些不是很清楚的地方。</p>

<p>每个部分按照比例进行划分：</p>

<ul>
<li>Logic and Process Automation (46%)</li>
<li>Data Modeling and Management (12%)</li>
<li>Testing (12%)</li>
<li>User Interface (10%)</li>
<li>Debug and Deployment tools (10%)</li>
<li>Salesforce Fundamentals (10%)</li>
</ul>

<p>建议在学习时按照从高比例到低比例的顺序，根据以上模块了解你哪些地方还需要花更多的时间去研究，可以做一个学习计划或制定一个考试时间。</p>

<h2 id="logicandprocessautomation">Logic and Process Automation</h2>

<p>这部分的内容占了整个考试的46%，就是说大约28 questions 在这一部分，所以需要花更多的时间在这一部分。</p>

<ul>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dynamic.htm">如何通过程序访问和利用 Object Schema</a>。（<a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_perms_enforcing.htm">哪些方法验证 Object 和 Field 访问权限</a>，<a href="https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS">CRUD 以及 FLS</a>。）</li>
<li><a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_formuladef.htm&amp;language=en_US">Formula fields 的功能以及如何使用</a>。（<a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=choosing_a_formula_data_type.htm&amp;language=en_US">Formula Data Types</a>，<a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_creating_cross_object_notes.htm&amp;language=en_US">Cross Object Formulas</a>。）</li>
<li><a href="https://help.salesforce.com/HTViewHelpDoc?id=fields_about_roll_up_summary_fields.htm">Roll-up Summary Fields</a> 的功能以及如何使用。（<a href="https://developer.salesforce.com/trailhead/module/point_click_business_logic">Roll-up Summary Fields TrailHead</a>，Roll-up Summary Fields 只能建立在 Master-detail Relation 上，不可以建立在Look-up Relation 上。）</li>
<li><a href="https://developer.salesforce.com/trailhead/module/business_process_automation">Declarative Process Automation Features 各自的功能</a>。（<a href="https://developer.salesforce.com/trailhead/business_process_automation/process_whichtool">比较 Process Builder、Workflow、Approval Process 以及 Visual Flow 的功能</a>，Workflow 可以更新 Parent Feilds，而 Process Builder 可以更新 Parent 或者 Children。）</li>
<li><a href="https://developer.salesforce.com/trailhead/business_process_automation/process_whichtool">明确什么时候使用 Declarative Automation Features vs. Apex classes And Rriggers</a>。</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/langCon_apex_datatypes_variables_intro.htm">Data Types and Variables</a>，<a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/langCon_apex_assignment_statements.htm">Assignment Statements</a>。</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/langCon_apex_control_flow.htm">如何使用 Apex Control Flow Statements</a>。（清楚什么时候使用 Inline SOQL Query In For Loop 什么时候不用。）</li>
<li>什么时候使用以及怎么使用 <a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_classes_understanding.htm">Apex Classes</a> 和 <a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_classes_interfaces.htm">Interfaces</a>。（怎样定义，如何使用内部类以及有哪些访问修饰符。）</li>
<li>如何使用基础的 <a href="https://developer.salesforce.com/trailhead/apex_database/apex_database_sosl">SOSL</a>, <a href="https://developer.salesforce.com/trailhead/apex_database/apex_database_soql">SOQL</a>, 和 <a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/langCon_apex_dml_section.htm?search_text=inner%20classes">DML statements</a>。（DML Statement vs Standard DML。）</li>
<li><a href="https://developer.salesforce.com/trailhead/module/apex_triggers">什么时候使用以及如何写 Triggers</a>。</li>
<li>Apex Transactions <a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_gov_limits.htm">Governor Limit</a>。（在一个 Transaction 中，通过 Soql 一次最多可以查询 50,000 条记录，通过 Dml 一次最多更新 10,000 条记录, 执行 100 次 SOQL 查询，150 次 DML 操作。 有些试题给你一些代码，判断整个 Transaction 成功提交所有改变，还是提交部分改变，还是没有改变被提交，计算DML或者SOQL语句执行的次数和记录成功执行的数量。）</li>
<li><a href="http://blog.meginfo.com.cn/salesforce-developer-1-certificaiton/Apex transactions">Apex Transactions</a>，<a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm">Triggers 以及 Order of Execution</a>。（当 Workflow 的 Field Update 触发的时候注意 Trigger 可能重复调用的情况。）</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.apex_workbook.meta/apex_workbook/">在 Apex 中如何进行异常控制</a>。（给你一段代码，判断哪一种异常会被抛出，可能是 Null Pointer Exception 或者 List Exception，认真读变量声明的代码行，看是否有没有初始化的变量用在 Apex 判断条件中，从而可能会引起 Null Pointer Exception。）</li>
<li>什么时候以及怎样使用 Standard Visualforce <a href="https://developer.salesforce.com/trailhead/visualforce_fundamentals/visualforce_standard_controllers">Controllers</a> vs Apex <a href="https://developer.salesforce.com/trailhead/visualforce_fundamentals/visualforce_custom_controllers">Custom Controllers</a> 以及 <a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_controller_extension.htm">Controller Extensions</a>。</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_data_intro.htm">在 Apex 和 Visualforce 中通过哪些程序技术阻止安全隐患</a>。</li>
</ul>

<h2 id="datamodelingandmanagement">Data Modeling and Management</h2>

<ul>
<li>基于给定的条件，判断<a href="https://developer.salesforce.com/trailhead/data_modeling/object_relationships">合适的 Data Model</a>。（根据条件选择使用 Look up，Master-detail 或者 Junction relation。）</li>
<li><a href="https://help.salesforce.com/HTViewHelpDoc?id=relationships_considerations.htm&amp;language=en_US">多种 Relationship，每个记录的访问 Access，User Interface (UI)，和 Object-oriented Programming 的功能</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/data_modeling/schema_builder">如何通过 Schema Builder 形象的创建实体关系</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/module/data_management">什么时候以及可以通过什么样的工具在 Development Environments 中 Importing 和 Exporting 数据</a>。（Data loader 或者 Built in import/export tools。）</li>
</ul>

<h2 id="testing">Testing</h2>

<ul>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests.htm">Testing 框架以及部署需求</a>。</li>
<li>如何写测试为 <a href="https://developer.salesforce.com/trailhead/apex_testing/apex_testing_triggers">Triggers</a>，<a href="https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_error_handling.htm">Controllers</a>，以及 <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_example.htm">Classes</a>。（Test.startTest() 和 Test.stopTest() 以及 Governor limit 怎么被重置。）</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_data.htm">何时以及如何通过多种方式引入测试数据</a>。（@Testsetup）</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm">如何执行一个或多个 Test Class</a>。（<a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_anonymous_block.htm?search_text=anonymous%20block">Execute Anonymous</a> vs <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests.htm?search_text=unit%20test">Unit Test</a>。）</li>
</ul>

<h2 id="userinterface">User Interface</h2>

<ul>
<li>通读关于 Visualforce 的 <a href="https://developer.salesforce.com/trailhead/module/visualforce_fundamentals">Trailhead</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/visualforce_fundamentals/visualforce_output_components">如何用 Visualforce 显示 Salesforce 数据</a>。（关于这个主题的内容是比较多的，但是基础的部分是足够的，可以看下关于 Visualforce Developer Guide 前面基础的内容部分。）</li>
<li>Visualforce page 可以显示哪些内容（Maps，Charts，Flows，PDF renderer 和 <a href="https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_styling_content_type.htm?search_text=content%20type">Custom content type</a>。）</li>
<li><a href="https://developer.salesforce.com/page/An_Introduction_to_Visualforce">描述如何将 Visualforce 应用到 Force.com Applications 中</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/lex_dev_overview/lex_dev_overview_lightning_components">Lightning Component Framework 的优势</a>。</li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_bundle.htm">Lightning Component 包含哪些资源</a>。</li>
</ul>

<h2 id="debuganddeploymenttools">Debug and Deployment tools</h2>

<ul>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm?search_text=anonymous%20block">如何监控和访问各个类型的 Debug Log</a>。（Log level，Logs Perspective，Filtering logs etc。）</li>
<li><a href="https://developer.salesforce.com/trailhead/alm_deployment/alm_tools">Developer Console，Workbench，以及 Force.com IDE 的功能和安全实现</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/alm_deployment/alm_tools">Metadata 以及 Business data 区别以及部署过程</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/alm_deployment/alm_sandbox">不同的 Environments 怎样在 Development 和 Deployment 过程中使用</a>。</li>
</ul>

<h2 id="salesforcefundamentals">Salesforce Fundamentals</h2>

<ul>
<li><a href="https://developer.salesforce.com/trailhead/starting_force_com/starting_understanding_arch">了解 Salesforce Architecture</a>。</li>
<li><a href="https://developer.salesforce.com/trailhead/visualforce_fundamentals/visualforce_standard_controllers">描述 Salesforce Platform Features 如何对应MVC模式</a>。</li>
<li>描述在 Salesforce Schema 中核心 CRM 对象的功能。（<a href="https://developer.salesforce.com/trailhead/module/admin_intro_accounts_contacts">Account &amp; Contact Trailead</a>, <a href="https://developer.salesforce.com/trailhead/module/admin_intro_opptys_leads">Lead &amp; Opportunity Trailead</a>，掌握这些对象的功能以及他们之间的相互关系。）</li>
<li><a href="https://developer.salesforce.com/trailhead/starting_force_com/starting_developer_console">明确 AppExchange 的作用以及使用场景</a>。</li>
<li>在假设的情景中，明确使用哪些 Declarative Customization。（在给定的问题条件下，明确是否可以使用 Formula, Roll-up summary field, Validation rule, Workflow rule, Process builder 或者 Approval process。）</li>
</ul>

<h2 id="importantlinks">其他 Important Links</h2>

<ul>
<li><p><a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_controller_considerations.htm">https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_controller_considerations.htm</a></p></li>
<li><p><a href="https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_controller_std_checking_accessibility.htm">https://developer.salesforce.com/docs/atlas.en-us.198.0.pages.meta/pages/pages_controller_std_checking_accessibility.htm</a></p></li>
<li><p><a href="https://developer.salesforce.com/page/Cheat_Sheets">https://developer.salesforce.com/page/Cheat_Sheets</a></p></li>
<li><p><a href="https://developer.salesforce.com/docs/atlas.en-us.workbook_vf.meta/workbook_vf/visualforce_workbook_audience.htm">https://developer.salesforce.com/docs/atlas.en-us.workbook_vf.meta/workbook_vf/visualforce_workbook_audience.htm</a></p></li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.apex_workbook.meta/apex_workbook/">https://developer.salesforce.com/docs/atlas.en-us.apex_workbook.meta/apex_workbook/</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[关于 Salesforce 认证的整体介绍]]></title><description><![CDATA[<blockquote>
  <p>Hire certified professionals. Certify your organization's success.</p>
</blockquote>

<p>做为一名 Salesforce 相关的从业者，无论你是 Admin 还是 Developer 有一件事情肯定是这个行业里经常提起的，就是 Salesforce 的认证。因为这个认证是 Salesforce 官方推出，并且考试的内容会随着 Salesforce 新功能推出持续更新，保证了知识的有效性和证书质量的可靠性。所以在行业内，大家对这个认证体系都是比较认可。为了让大家能更好的了解和准备 Salesforce 的认证，我们将陆续给大家介绍一些相关认证的资料和准备方式，希望对大家能有所帮助。这次先给大家整体介绍一下常见的认证。</p>

<p>介绍之前先说两个常见的概念：</p>

<ul>
<li>Salesforce.com: 一个 SaaS （软件即服务）平台，提供行业标准的 CRM 服务。</li>
<li>Force.com: 一个 PaaS （平台即服务） 平台，针对开发人员，</li></ul>]]></description><link>http://blog.meginfo.com.cn/about-salesforce-certifications/</link><guid isPermaLink="false">765caf3d-1a72-4b03-a8ad-678352ab262d</guid><category><![CDATA[Certification]]></category><dc:creator><![CDATA[Jair Zheng]]></dc:creator><pubDate>Sun, 10 Jul 2016 13:30:00 GMT</pubDate><content:encoded><![CDATA[<blockquote>
  <p>Hire certified professionals. Certify your organization's success.</p>
</blockquote>

<p>做为一名 Salesforce 相关的从业者，无论你是 Admin 还是 Developer 有一件事情肯定是这个行业里经常提起的，就是 Salesforce 的认证。因为这个认证是 Salesforce 官方推出，并且考试的内容会随着 Salesforce 新功能推出持续更新，保证了知识的有效性和证书质量的可靠性。所以在行业内，大家对这个认证体系都是比较认可。为了让大家能更好的了解和准备 Salesforce 的认证，我们将陆续给大家介绍一些相关认证的资料和准备方式，希望对大家能有所帮助。这次先给大家整体介绍一下常见的认证。</p>

<p>介绍之前先说两个常见的概念：</p>

<ul>
<li>Salesforce.com: 一个 SaaS （软件即服务）平台，提供行业标准的 CRM 服务。</li>
<li>Force.com: 一个 PaaS （平台即服务） 平台，针对开发人员，有平台独特的语言，开发人员可以在这个平台上开发各种 App。</li>
</ul>

<h2 id="administratorhttpcertificationsalesforcecomadministrators"><a href="http://certification.salesforce.com/administrators">Administrator (管理员)</a></h2>

<p>Administrator 主要是针对 Salesforce.com 这个平台，一个企业要实施和使用 Salesforce，一个管理员会起到了非常重要的角色。所以 Salesforce 专门针对这部分人群推出了下面两个考试认证：</p>

<h3 id="administrator201">Administrator (201)</h3>

<p>Administrator 初级认证，代号 201，主要针对接触 Salesforce 时间不长，想全面了解 Salesforce.com 这个 CRM 平台推出的。考试内容的话，主要涉及：</p>

<ol>
<li>系统配置：Organization, User，User Interface, Security  </li>
<li>数据模型：Standard 和 Custom Objects  </li>
<li>Sales cloud 和 Service cloud  </li>
<li>数据管理：导入和导入数据等  </li>
<li>数据分析：Reprot 和 Dashboard  </li>
<li>基本自动的化：Workflow 的使用</li>
</ol>

<p><strong>考试要求</strong></p>

<ul>
<li>60 multiple-choice questions</li>
<li>90 minutes allotted to complete the exam</li>
<li>65% is the passing score</li>
<li>Registration fee is USD 200</li>
</ul>

<p>上面是考试要求，60 道多选题，考试时间 90 分钟，65% 算考过，也就是你需要答对 40 道题。考试费的话是 200 美金。如果第一次没过考过，第二次需要再交 100 美金。</p>

<h3 id="advancedadministrator211">Advanced Administrator (211)</h3>

<p>Advanced Administrator 认证，代号 211，是 201 的升级，需要拥有 201 证书以后才可以报名这个考试。考试的范围和 201 相差不大，不过需要你对每个部分的有一个更深入的了解，会使用更高级的功能。一个好的管理员，必备证书之一。</p>

<p><strong>考试要求和 201 一样</strong></p>

<ul>
<li>60 multiple-choice questions</li>
<li>90 minutes allotted to complete the exam</li>
<li>65% is the passing score</li>
<li>Registration fee is USD 200</li>
</ul>

<h2 id="developerhttpcertificationsalesforcecomplatformdevelopers"><a href="http://certification.salesforce.com/platform-developers">Developer (开发）</a></h2>

<p>Developer 的认证的话，主要针对 Force.com 这个平台。之前大家可能比较常听说的就 401 和 501，但去年 Salesforce 做了一次升级，变成了 Developer I 和 Developer II，最大的改变应该就是开发人员的初级认证，之前的考 401 的话，你是不需要懂代码，也是可以拿到这个证书的，所以一个不懂开发的管理员也可以比较容易的拿到这个证书。升级后的 Developer I，加入了代码部分考核。</p>

<h3 id="developeri450">Developer I (450)</h3>

<p>Developer I，开发人员的初级认证，代号 450，考试要去的话，比原来的 401 难了不少，除了 Data Model 这一块和 Admin 重叠以外，其他的都是代码了。主要是 Apex 和 Visualforce，还有要大体了解下 Lightning Component。如果之前没有接触过 Salesforce，但有其他语言开发经验，推荐 2－3 个月的准备时间。</p>

<p><strong>考试要求</strong></p>

<ul>
<li>60 multiple-choice questions</li>
<li>105 minutes allotted to complete the exam</li>
<li>68% is the passing score</li>
<li>Registration fee is USD 200</li>
</ul>

<p>105 分钟，60 道多选题，68% 才可以过，你需要答对 41 道题，比 Admin 的多了一道 :)，不过时间更充裕了。</p>

<h3 id="developerii">Developer II</h3>

<p>Developer II，开发人员的高级认证，更有含金量一些，因为考试步骤跟多，费用更高。建议至少拥有一年以上 Force.com 开发经验的人准备。考试的要求就不细说了，有兴趣的可以留言。下面详细说一下考试步骤，主要分三步：</p>

<p><strong>一. 选择题</strong></p>

<ul>
<li>60 multiple-choice questions</li>
<li>120 minutes allotted to complete the exam</li>
<li>63% is the passing score</li>
<li>Registration fee is USD 400</li>
</ul>

<p>和其他考试一样，首先要考过选择题，考试形式和 450 相同。120 分钟 60 到选择题，63% 过，答对 38 道题。费用是 450 的两倍，400 美金。</p>

<p><strong>二. Programming Assignment</strong></p>

<p>考过选择题以后，你就需要去预约这个 Programming Assignment，注意这个一年就开放几次，错过了可能就要等几个月，所以一定要留意邮件通知和官网通告。预约上以后，Salesforce 会单独给你发邮件，会给你一个他们定义好的需要文档，让你在 30 天的时间去完成这个程序。官方给出的推荐时间是 20 个小时。规定的时间到了以后，你就不能再改代码了。然后进行第 3 部分。</p>

<p><strong>三. Essay Exam</strong></p>

<p>这部分的话，需要你去登陆考试系统预约，然后和做选择题类似，到指定的时间，就可以去考试了。考试内容是 5 到问答题，需要再 60 分钟内完成。</p>

<p>这三部分完成后，剩下的就是等待考试结果了。整个过程大致需要需要 2－3个月。</p>

<h2 id="appbuilderhttpcertificationsalesforcecomappbuilders"><a href="http://certification.salesforce.com/app-builders">App Builder</a></h2>

<p>App Builder 是 Salesforce 去年升级 Developer 多出来的一个证书，整体应该是原来 401 的一个升级，加入更多 Lightning 的东西，建议 Developer 考一下这个证书。如果只是会写 code 的话，其实不能算上一个合格的 Salesforce 开发，因为 Force.com 除了代码，还提供了很多强大的功能，比如：Formula, Roll-up fields，workflow, process builder 等。</p>

<p>考试要求：</p>

<ul>
<li>60 multiple-choice questions</li>
<li>90 minutes allotted to complete the exam</li>
<li>63% is the passing score</li>
<li>Registration fee is USD 200</li>
</ul>

<h2 id="implementationexpertshttpcertificationsalesforcecomimplementationexperts"><a href="http://certification.salesforce.com/implementation-experts">Implementation Experts</a></h2>

<p>这部分主要是对每个不同领域的细分，主要分为：</p>

<ul>
<li>Sales Cloud Consultant</li>
<li>Service Cloud Consultant</li>
<li>Pardot Consultant credential</li>
<li>Marketing Cloud Consultant credential</li>
</ul>

<p>如果你对每个具体的产品有更深入的要求的话，可以考虑上面的证书。</p>

<p>考试形式都是选择题，费用 200 美金。</p>

<h2 id="">其他</h2>

<p>Salesforce 除了上面介绍的这些认证之外，还有一个就是压轴的 Technical Architect，含金量相当高，因为考试费加起来就需要 $6,500 (美金哦，努力吧，少年！)。因为这些相对小众，所以就不介绍了，有兴趣的可以去<a href="http://certification.salesforce.com/">官网</a>了解详情。</p>

<h2 id="">维护证书</h2>

<p>因为 Salesforce 每年都会 release 3次，所以每次 release 后，你都需要维护一下你的证书，在线上做一下相应的题目，好处就是开卷的，你可以查资料。</p>

<p>除了每次 release 考试以外，还需要<strong>每年</strong>交 <strong>$100</strong> 美金的维护费（对于国内这个费用还是有点小高）。</p>

<p>PS: 如果不维护，证书就过期了，需要重新再考。</p>

<h2 id="">关于考试</h2>

<p>首先需要注册一个账号，打开认证官网: <a href="http://www.webassessor.com/salesforce">http://www.webassessor.com/salesforce</a>, 点击右上角的 <strong>REGISTER FOR EXAM</strong>，按照步骤提示注册完成。</p>

<p>然后根据你的情况，选择考试类型，主要同一个类型的考试，一般会有两个选项，主要是考试形式的不同：</p>

<ol>
<li><p>线下考试中心 <br>
可以在考试的网站上，预约线下的考试中心，国内主要的城市是有的。如果你所在城市没有，也不用担心，可以用第二种方式。</p></li>
<li><p>线上方式 <br>
只需要准备一摄像头（笔记本自带不可以)，下载一个软件安装在电脑上就可以了。最后有比较稳定的 VPN，以为考试的过程中，对方是会通过摄像头全程监控的是考试过程的。如果网络不好，或者你有姿势不符合规定，对方会把你暂停，不过不用着急，你可以在线聊天的方式和对方沟通，一般问题都不大。</p></li>
</ol>

<p>关于多选题：考试的题目中选择题是有多选的，不过比较好的就是提供会告诉你需要选择几个正确的，稍微降低了一点难度。</p>

<h2 id="">证书验证</h2>

<p>可以在这个地址验证一个人所持有的证书：<a href="http://certification.salesforce.com/verification">http://certification.salesforce.com/verification</a></p>

<h2 id="">结语</h2>

<p>这篇 Blog 主要根据 Salesforce 的认证官方提供的资料整理，让大家对认证体系有一个整体的认识，提供的信息都具有时效性，所以考试前，建议大家要上官方查看最新的资料：<a href="http://certification.salesforce.com">http://certification.salesforce.com</a></p>

<blockquote>
  <p>Note: 通过考试，系统的完善自己的知识体系，增加个人能力，享受准备考试的过程吧。</p>
</blockquote>]]></content:encoded></item><item><title><![CDATA[Web-to-Lead 的使用]]></title><description><![CDATA[<p>Web-to-Lead 是 Salesforce 一个很重要的特型，但也很容易被人忽视。Web-to-Lead 提供了一个从外部网站很简单的创建一个 Lead 到 Salesforce 的方式。在 Salesforce 中利用 Web-to-Lead 功能可以生成一个简单的 Form 表单，之后可以把这个 Form 表单内嵌到我们的外部网页中。接下来我们看一下如何创建，发布和调试 Web-to-Lead。</p>

<h2 id="webtolead">创建 Web-to-Lead</h2>

<p><strong>Setup > Build > Customize > Leads > Web-to-Lead</strong>
<img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-01.png" width="700px"></p>

<p><strong>Web-to-Lead Enabled</strong> checkbox – 当这个值为 True 的时候，才能使用 Web-to-Lead 功能。</p>

<p><strong>Default Record Creator</strong> – 当 Lead 被创建的时候，这个值会作为 Lead 上的 "Created</p>]]></description><link>http://blog.meginfo.com.cn/how-to-use-web-to-lead/</link><guid isPermaLink="false">c4a02468-987c-4440-a9ba-1ac79bc2347a</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[sfdctips]]></category><category><![CDATA[admin]]></category><dc:creator><![CDATA[Samba]]></dc:creator><pubDate>Fri, 24 Jun 2016 09:51:00 GMT</pubDate><content:encoded><![CDATA[<p>Web-to-Lead 是 Salesforce 一个很重要的特型，但也很容易被人忽视。Web-to-Lead 提供了一个从外部网站很简单的创建一个 Lead 到 Salesforce 的方式。在 Salesforce 中利用 Web-to-Lead 功能可以生成一个简单的 Form 表单，之后可以把这个 Form 表单内嵌到我们的外部网页中。接下来我们看一下如何创建，发布和调试 Web-to-Lead。</p>

<h2 id="webtolead">创建 Web-to-Lead</h2>

<p><strong>Setup > Build > Customize > Leads > Web-to-Lead</strong>
<img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-01.png" width="700px"></p>

<p><strong>Web-to-Lead Enabled</strong> checkbox – 当这个值为 True 的时候，才能使用 Web-to-Lead 功能。</p>

<p><strong>Default Record Creator</strong> – 当 Lead 被创建的时候，这个值会作为 Lead 上的 "Created By" field。大部分情况下，这个值也被作为 Lead Record Owner, 但是如果你配置了 Lead Auto-Assignment rules 后，Owner 可能会被改变。</p>

<p><strong>Default Response Template</strong> – 如果这个值不为空的话，哪么当一个 Lead 被提交后，将使用你填充的值给 Lead 的 Owner 发送邮件。如果你需要根据不同的条件（Form 表单上的某些值）发送不同的 Email Template 给 Lead 的 Owner，哪么，我们需要设置这个值为空并且到这里<strong>Setup > Build > Customize > Leads > Lead Auto-Response Rules</strong> 配置你所需要的 Lead Assignment Rules。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-02.png" width="700px"></p>

<p>好了, 现在单击 <strong>Create your Web-to-Lead Form</strong>。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-03.png" width="700px"> <br>
<strong>Select the fields to include on your Web-to-lead form</strong> – 添加你所需要的字段到 Form 表单。另外如果你需要额外的信息来存储，可以创建对应的 Custom Fields 并且添加他们到表单中。</p>

<p><strong>Return URL</strong> – 当表单提交后，页面会跳转到这个路径。</p>

<p>单击 <strong>Generate</strong> button。生成以下代码。</p>

<pre><code class="language-html">&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;!--  NOTE: Please add the following &lt;META&gt; element to your page &lt;HEAD&gt;.      --&gt;  
&lt;!--  If necessary, please modify the charset parameter to specify the        --&gt;  
&lt;!--  character set of your HTML page.                                        --&gt;  
&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"&gt;  
&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;!--  NOTE: Please add the following &lt;FORM&gt; element to your page.             --&gt;  
&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"&gt;  
&lt;input type=hidden name="oid" value="00D90000000****"&gt;  
&lt;input type=hidden name="retURL" value="http://www.baidu.com"&gt;  
&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;!--  NOTE: These fields are optional debugging elements. Please uncomment    --&gt;  
&lt;!--  these lines if you wish to test in debug mode.                          --&gt;  
&lt;!--  &lt;input type="hidden" name="debug" value=1&gt;                              --&gt;  
&lt;!--  &lt;input type="hidden" name="debugEmail" value="samba.gao@hotmail.com"&gt;   --&gt;  
&lt;!--  ----------------------------------------------------------------------  --&gt;  
&lt;label for="first_name"&gt;First Name&lt;/label&gt;&lt;input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /&gt;&lt;br&gt;  
&lt;label for="last_name"&gt;Last Name&lt;/label&gt;&lt;input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /&gt;&lt;br&gt;  
&lt;label for="email"&gt;Email&lt;/label&gt;&lt;input  id="email" maxlength="80" name="email" size="20" type="text" /&gt;&lt;br&gt;  
&lt;label for="company"&gt;Company&lt;/label&gt;&lt;input  id="company" maxlength="40" name="company" size="20" type="text" /&gt;&lt;br&gt;  
&lt;label for="city"&gt;City&lt;/label&gt;&lt;input  id="city" maxlength="40" name="city" size="20" type="text" /&gt;&lt;br&gt;  
&lt;label for="state"&gt;State/Province&lt;/label&gt;&lt;input  id="state" maxlength="20" name="state" size="20" type="text" /&gt;&lt;br&gt;  
&lt;input type="submit" name="submit"&gt;  
&lt;/form&gt;
</code></pre>

<h2 id="webtolead">发布 Web-to-Lead</h2>

<p>把上面生成的代码保存到一个 html 文件中，之后用浏览器打开这个文件。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-04.png" alt=""></p>

<p>填充正确的信息后，单击 Submit button, 这些信息会保存到 Salesforce  Lead 记录上并跳转到<a href="http://www.baidu.com">www.baidu.com</a>。</p>

<h2 id="webtolead">调试 Web-to-Lead</h2>

<p>首先我们来分析下面这段代码。</p>

<pre><code class="language-html">&lt;form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"&gt;  
&lt;input type=hidden name="oid" value="00D90000000****"&gt;  
&lt;input type=hidden name="retURL" value="http://www.baidu.com"&gt;  
</code></pre>

<p><strong>action</strong> - 这是一个很重要的 URL, 当表单提交后，会以 POST 的形式发送到 Salesforce。</p>

<p><strong>oid</strong> - Salesforce 中的 Org ID, 你能找到它在 <strong>Setup > Administer > Company Profile > Company Information</strong> – 你将看到 Salesforce Org ID 的值。</p>

<p><strong>retURL</strong> - 表单提交后跳转的 URL 路径。</p>

<p>接着继续分析下面的代码</p>

<pre><code class="language-html">&lt;input type="hidden" name="debug" value=1&gt;  
&lt;input type="hidden" name="debugEmail" value="samba.gao@hotmail.com"&gt;  
</code></pre>

<p>上面的代码默认是注释的，为了方便调试，我们需要把注释去掉。如果 debug 的值是1的话，在表单提交后你会看到一些调试的信息。
<img src="http://blog.meginfo.com.cn/content/images/2016/06/web-to-lead-05.png" alt=""></p>

<h2 id="">结语</h2>

<p>更多 Salesforce 学习资料将在后续推出，敬请关注。如果有什么问题可以发送到我的邮箱：samba.gao@meginfo.com。</p>]]></content:encoded></item><item><title><![CDATA[Salesforce Summer '16 Release 亮点功能介绍，Lightning 未来的方向]]></title><description><![CDATA[<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14657982205119.jpg" alt=""></p>

<blockquote>
  <p>Lightning is the fastest way to connect with customers, employees, and partners</p>
</blockquote>

<p>时间过的好快，感觉总结 Spring '16 还没有出来多久，Summer '16 就来了！这次 Release 是官方的第 50 次更新！对于成立 17 年的 Salesforce 来说，应该算是一个里程碑 － 新产品 Lightning 有很多新功能。 6／11号过后，所有的 Org 都已经升级到了 Summer '16 了。</p>

<p>在开始介绍 Summer '16 的新功能前，发表下个人的见解。虽然 Lightning 还不是很成熟，</p>]]></description><link>http://blog.meginfo.com.cn/salesforce-summer-16-release-what-you-need-to-know/</link><guid isPermaLink="false">642e229f-4359-424a-aae0-03c96ffff90b</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[Release]]></category><dc:creator><![CDATA[Jair Zheng]]></dc:creator><pubDate>Tue, 21 Jun 2016 12:57:19 GMT</pubDate><content:encoded><![CDATA[<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14657982205119.jpg" alt=""></p>

<blockquote>
  <p>Lightning is the fastest way to connect with customers, employees, and partners</p>
</blockquote>

<p>时间过的好快，感觉总结 Spring '16 还没有出来多久，Summer '16 就来了！这次 Release 是官方的第 50 次更新！对于成立 17 年的 Salesforce 来说，应该算是一个里程碑 － 新产品 Lightning 有很多新功能。 6／11号过后，所有的 Org 都已经升级到了 Summer '16 了。</p>

<p>在开始介绍 Summer '16 的新功能前，发表下个人的见解。虽然 Lightning 还不是很成熟，但从发布会的 3 次 release 和一些消息来看，Lightning 已经成为 Salesforce 接下来发展非常重要的一部分。所以作为 Admin 和 Developer，建议对它保持持续的关注，让自己能有一个更好的知识过渡。这里推荐一个 Trailhead 的 <a href="https://developer.salesforce.com/trailhead/trail/lex_admin_migration">Migrate to Lightning Experience</a> trail, 可以来整体了解 Lightning。</p>

<blockquote>
  <p>从今年的 Q2 开始 Salesforce 把产品线也进行了更新：
  Salesforce’s <strong>Professional Edition</strong>, <strong>Enterprise Edition</strong> and <strong>Unlimited Edition</strong> for Sales Cloud and Service Cloud will be replaced by new <strong>Lightning Professional Edition</strong>, <strong>Lightning Enterprise Edition</strong> and <strong>Lightning Unlimited Edition</strong> for Sales Cloud and Service Cloud.</p>
</blockquote>

<h2 id="adminandcustomers">Admin and Customers</h2>

<p><strong>1. Create and Edit Lightning Experience Home Pages</strong></p>

<p>Lightning Experience 的 Home 页面再经历了两次更新后，在这次终于可以进行<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_sales_home_customize_create.htm">定制化</a>了。发布之初，因为 Lightning 主要是针对 Sales 来发布的，首页显示的是一些销售数据和报表等，所以其他的部门用起来，基本首页就废掉了。这次 Salesforce 把他们平台的灵活可定制的优点也带到了 Home 页，和传统的 Home 页原理相似，可以定制首页的不同模块，然后根据 Profile 就行分配。给你多了一个选择 Lightning 的理由。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14663334851527.png" alt=""></p>

<p><strong>2. Create a Calendar from Anything in Salesforce</strong></p>

<p>Lightning 最大的改变对用户来说应该就是 UI，所以 Salesforce 也不断的再推出能够提供更好数据显示的方式。这次推出了可以把不同 objects 根据日期字段显示在 <a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_sales_activities_calendar_create.htm">Calendar</a> 上的功能，让我们有了一种更直观的方式显示数据的日期。</p>

<p>这里给出一些使用场景，比如：Opportunity close dates, Task due dates, Campaign start dates 等，让你能用直观的方式把握每一项工作的日期。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14663248627054.png" alt=""></p>

<p><strong>3. Shortcuts for Currency and Number Fields in Lightning Experience</strong></p>

<p>一个用户使用上一个小细节的体现，我们在录入数据的时候，如果遇到数字类型的，就可以 <strong>k</strong>, <strong>m</strong>, <strong>b</strong>, <strong>t</strong> 去表示 千，百万，十亿 和 万亿。比如输入 1k = 1,000，非常方便。<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_general_currency_shortcuts.htm">这个功能</a>在 Lightning Experience, Salesforce Classic, 和 Salesforce1 mobile app 上都支持。</p>

<p><strong>4. Associate a Contact with Multiple Accounts</strong></p>

<p>在 Salesforce 的标准对象的数据模型中，Account 和 Contact 是<strong>1对多</strong>，就是一个公司可以有多个员工。但是现实世界是复杂的，很多时候在公司和员工之间可以是一个多对多的关系，比如一个人，他是公司的负责人，但同时他也参加了一个公益组织，在里边负责相关工作。正好这两家公司都和你们有业务来往，那按照之前的标准模型，只能在系统里再创建一条重复的 Contact 了。</p>

<p>现在你可以把<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_sales_shared_contacts.htm">一个 Contact 关联到多个 Account</a>了。在 UI 上是区分主次的，在 Related list 中的是所有相关的 Accounts, 勾选了 <strong>Direct</strong> 的 Account，会显示在 <strong>1</strong> 的位置。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14663266956525.png" alt=""></p>

<p><strong>5. Save Time by Cloning Sandboxes(Pilot)</strong></p>

<p><a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_deployment_sandbox_to_sandbox.htm#rn_deployment_sandbox_to_sandbox">Clone Sandbox</a> 非常不错的功能，可以在创建 Sandbox 的时候，选择一个已经正在使用的 Sandbox 去 clone，有的时候能帮我们节省掉很多的时间，比如你开发到一半的时候，突然有了两个不同的想法，都想试一试。这时候就可以 clone 一下当前的 Sandbox，复制出一个新的 Sandbox，实现另外一个想法，省掉了回滚和部署的时间。</p>

<p><strong>6. Processes Can Execute Actions on More Than One Criteria</strong></p>

<p>Process 又更新了，这次是一个更加强大的功能，可以在 Process 中<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_forcecom_process_multiple_actions.htm#rn_forcecom_process_multiple_actions">触发多个条件对应的 Actions</a>。详细解释之前，先来看一下之前的版本。下面这个 Process 的执行顺序是：如果满足 <strong>1</strong>，就执行 <code>Post to Support</code> 这个 action，完成后，整个 Process 就结束，不管后续的条件。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14663292392642.png" alt=""></p>

<p>新版本中，看图中 <strong>5</strong> 的位置，多出了一个 <strong>Evaluate the next criteria</strong> 的选项，选择这个以后，在执行了一个条件对应的 Actions 之后，Process 可以继续下一个条件，检查是否满足，如果满足再执行这个条件对应的 Actions。这样的话，我们就可以在一个 Process 中来集中管理一个对象对应的不同业务场景了。避免出现创建太多的 Process，维护起来很难处理的情况（有的时候出了问题，Workflow 有时候检查起来就是噩梦啊）。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14656870703395.png" alt=""></p>

<p><strong>7. Eliminate Picklist Clutter with Restricted Picklists (Generally Available)</strong></p>

<p>Spring '16 推出的一个功能，可以让我们限制一个 Picklist 字段中存储的值只能是在 Picklist 中定义好的选项，这样可以保证我们的数据整洁，在运行报表等情况下更好的筛选和分组。具体的开启方式可以看<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_forcecom_picklists_restricted_picklists_ga.htm">这里</a>。</p>

<p><strong>8. Dress up Your Data with New Charts in Lightning Experience</strong></p>

<p>在 Lightning Experience 中<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_rd_reports_dashboards_charts.htm">新增几种图标类型</a>：funnel, scatter, combo, and cumulative line charts。具体表现形式看图：</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14663334851527-1.png" alt=""></p>

<p><strong>9. Give Your Lightning Experience and Salesforce1 Users the Power of Flows (Pilot)</strong></p>

<p>如果你使用 Flow 的话，就会感觉功能好强大，但 UI 好难看啊！这次 Salesforce 推出了可以让 <a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_forcecom_flow_lab.htm">Flow 运行在 Lightning Experience 和 Salesforce1</a> 的新功能，同时拥有了 Lightning 现代感的界面。</p>

<p>图中 Survey Customers 是一个 Flow:</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14665085324369.png" alt=""></p>

<blockquote>
  <p>如果没有用过 Flow 的话，可以看一下我们的这篇 Blog: <a href="http://blog.meginfo.com/visual-workflow-flow-create-form/">如何使用 Visual Workflow (Flow) 创建表单</a></p>
</blockquote>

<p><strong>10. Remove Custom Tabs limit</strong></p>

<blockquote>
  <p>If you use a Professional, Enterprise, or Unlimited Edition org, you can now use as many custom tabs as you want.</p>
</blockquote>

<p><a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_editions_general_limits_increased.htm">Salesforce 终于把 25 tab 的限制去掉了</a>，现在的数量很难用完了。具体多少个，可以看 Org 的 System overview。</p>

<p><strong>11. Export Reports as Files from Lightning Experience</strong></p>

<p>现在可以在 Lightning Experience 导出报表了。</p>

<p><strong>12. Create New Accounts Lightning Fast with Account Autofill</strong></p>

<p>在创建 Account 的时候，可以<a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_sales_accounts_suggestions.htm">自动帮你填充一些数据</a>。实际测试了一下，对国内公司都不支持。如果你的客户是国外的话，可以考虑开起这个功能。开启的时候可以顺便打开 Account Logos 这个功能，不过国内公司无用！</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14665120742706.png" alt=""></p>

<h2 id="developer">Developer</h2>

<p><strong>1. Create and Edit Lightning Experience Record Pages (Generally Available)</strong></p>

<p>Lightning Experience record page 可以自定了。用了一下这个功能，感觉比 Page layout 还要强大！</p>

<p><strong>2. Visualforce for Lightning Experience is Generally Available</strong></p>

<p>Visualforce 可以运行在 Lightning Experience 中了，不过这并不是意味着 Visualforce 所有的功能都可以正常运行。所以建议，可以在 Sandbox 测试完成以后，在决定是不是开启 Lightning。</p>

<p><strong>3. View Apex Test Results More Easily</strong></p>

<p>可以通过 <strong>Apex Test History</strong> page 去查看 Test method 的历史纪录，不过这个功能竟然只在 Lightning Experience 才有。</p>

<p><img src="http://blog.meginfo.com.cn/content/images/2016/06/14665097955216.jpg" alt=""></p>

<p><strong>4. View Visualforce Controller Exceptions in Debug Logs</strong></p>

<p>Visualforce Controller 的异常现在可以在 Debug Log 里看到了。之前只能在 Page 上才能看到。</p>

<p><strong>5. Suppress Null Values When Serializing Apex Objects</strong></p>

<p><code>JSON.serialize</code> 是非常好用的方法，不过之前的话，会出现 <code>Null</code> 这种值。现在我们可以使用 <code>suppressApexObjectNulls = true</code>，去掉结果中的 <code>Null</code>。</p>

<p><strong>6. Get a Map of Populated SObject Fields</strong></p>

<p>SObject 新增加了一个方法，可以让我们更方便的获取已经在内存中的 Fields，比如用 SOQL 查询出来了一个 SObject，之前相关通过代码获取有哪些 Fields 别查询出来的，是很难的。现在可以用下面这个方法，获取在内存中 Fields，这样我们可以更加灵活的使用这些字段或者检查当前在内存中SOjbect 有没有你需要的 Fields。</p>

<pre><code class="language-java">Map&lt;String, Object&gt; getPopulatedFieldsAsMap()  
</code></pre>

<p>具体的使用方式：</p>

<pre><code class="language-java">Account a = new Account();  
a.name = 'TestMapAccount1';  
insert a;  
a = [select Id,Name from Account where id=:a.Id];  
Map&lt;String, Object&gt; fieldsToValue = a.getPopulatedFieldsAsMap();

for (String fieldName : fieldsToValue.keySet())  
{
    System.debug('field name is ' + fieldName + ', value is ' + 
        fieldsToValue.get(fieldName));
}

// Example debug statement output:
// DEBUG|field name is Id, value is 001R0000003EPPkIAO
// DEBUG|field name is Name, value is TestMapAccount1
</code></pre>

<blockquote>
  <p>A field is populated in memory in the following cases.
      - The field has been queried by a SOQL statement.
      - The field has been explicitly set before the call to the getPopulatedFieldsAsMap() method.</p>
</blockquote>

<p>上面介绍的新功能希望对大家有所帮助，要想全面了解 Summer '16 可以在这里查看最新的 <a href="https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/salesforce_release_notes.htm">HTML release note</a>。 Salesforce 的第 50 个 release 给我们带来了很多有价值的东西，也代表一种趋势 － <strong>Lightning</strong>。</p>

<h2 id="">相关推荐</h2>

<ul>
<li><a href="https://www.salesforce.com/video/245969/?d=sessions-filter">Developer Preview Live – Release Readiness LIVE, Summer ’16</a></li>
<li><a href="https://developer.salesforce.com/trailhead/module/summer_16">Summer '16 Release on Trailhead</a></li>
<li><a href="http://www.fishofprey.com/2016/05/ive-just-found-my-new-favorite-apex.html">Summer '16 new Apex Method - Get a Map of Populated SObject Fields</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[如何使用 Salesforce Live Agent (三)]]></title><description><![CDATA[<p>前两篇我们已经讲解了如何对 Live Agent 进行配置。这一章我们将做一个例子来演示以下配置的结果。</p>

<p>首先让我们来检查一下前面生成的代码文件, 命名为 Live Agent.html</p>

<pre><code class="language-html">&lt;img id="liveagent_button_online_57390000000XZEZ" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('57390000000XZEZ')" src="https://testprint2014-developer-edition.ap1.force.com/resource/1463649046000/OnlineChatbutton" /&gt;&lt;img id="liveagent_button_offline_57390000000XZEZ" style="display: none; border:</code></pre>]]></description><link>http://blog.meginfo.com.cn/how-to-use-salesforce-live-agent-3/</link><guid isPermaLink="false">38c73d18-bd51-43b4-9017-e288fc063767</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[admin]]></category><dc:creator><![CDATA[Samba]]></dc:creator><pubDate>Tue, 31 May 2016 09:05:42 GMT</pubDate><content:encoded><![CDATA[<p>前两篇我们已经讲解了如何对 Live Agent 进行配置。这一章我们将做一个例子来演示以下配置的结果。</p>

<p>首先让我们来检查一下前面生成的代码文件, 命名为 Live Agent.html</p>

<pre><code class="language-html">&lt;img id="liveagent_button_online_57390000000XZEZ" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('57390000000XZEZ')" src="https://testprint2014-developer-edition.ap1.force.com/resource/1463649046000/OnlineChatbutton" /&gt;&lt;img id="liveagent_button_offline_57390000000XZEZ" style="display: none; border: 0px none; " src="https://testprint2014-developer-edition.ap1.force.com/resource/1463649035000/OfflineChatbutton" /&gt;  
&lt;script type="text/javascript"&gt;  
if (!window._laq) { window._laq = []; }  
window._laq.push(function(){liveagent.showWhenOnline('57390000000XZEZ', document.getElementById('liveagent_button_online_57390000000XZEZ'));  
liveagent.showWhenOffline('57390000000XZEZ', document.getElementById('liveagent_button_offline_57390000000XZEZ'));  
});&lt;/script&gt;

&lt;script type='text/javascript' src='https://c.la1t1.salesforceliveagent.com/content/g/js/36.0/deployment.js'&gt;&lt;/script&gt;  
&lt;script type='text/javascript'&gt;  
liveagent.init('https://d.la1t1.salesforceliveagent.com/chat', '57290000000XZDu', '00D90000000nhdy');  
&lt;/script&gt;  
</code></pre>

<p>接下来创建一个 Console App。</p>

<ul>
<li>单击 Setup, 在 Quick Find 搜索中输入 Apps，单击 <strong>Apps</strong>。</li>
<li>在 Apps 部分单击 New。</li>
<li><p>选择 Console，单击 Next。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-1-1.png" width="700px"></p></li>
<li><p>在 App Label 中输入 <strong>Live Agent App With WeChat</strong>，单击 Next。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-2-1.png" width="650px"></p></li>
<li><p>在选择 Console Logo处，默认设置，单击 Next。</p></li>
<li>在选择导航处，默认 Cases，单击 Next。</li>
<li>在怎样显示处，默认设置，单击 Next。</li>
<li><p>选择 Include Live Agent in this App，单击 Next。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-3.png" width="700px"></p></li>
<li><p>分配 Profiles，单击 Save。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-4.png" width="700px"></p></li>
</ul>

<p>选择 Live Agent App With WeChat。单击右下角的 Live Agent, 修改 Offline 到 Online。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-5-1.png" alt="">
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-6.png" width="700px"></p>

<p>打开 Live Agent.html 页面，单击 Online 图标。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-7.png" alt="">
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-8.png" alt=""></p>

<p>在 Salesforce Console 里将收到一个来访者邀请，单击 Accept 之后将建立通信，可以进行聊天。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-9-1.png" alt="">
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-3-10-1.png" alt=""></p>

<p>到此，大家应该知道如何对 Live Agent 进行配置和开发。我们这里只是讲解了使用 Live Agent 基本的功能，它还有一些更强大的功能，像 <strong>Automated Invitation</strong>，如果大家有兴趣的话，可以尝试一下。</p>]]></content:encoded></item><item><title><![CDATA[如何使用 Salesforce Live Agent (二)]]></title><description><![CDATA[<p>接着上一篇我们继续往下讲。</p>

<h2 id="liveagentconfigurations">第六步: 设置 Live Agent Configurations</h2>

<p>Live Agent configurations 可以为你定制一个有效的 Agent，并且提供了监视 Agent 和 Customer 聊天的功能。</p>

<ul>
<li>单击 Setup, 在 Quick Find 搜索中输入 Live Agent Configurations，然后选择 <strong>Live Agent Configurations</strong>。</li>
<li>Click New。</li>
<li>在 Live Agent Configuration 的 Name 处输入 WeChat Agent Configuration。</li>
<li>勾选 Sneak Peek Enable, Request Sound Enabled, Disconnect Sound</li></ul>]]></description><link>http://blog.meginfo.com.cn/how-to-use-salesforce-live-agent-2/</link><guid isPermaLink="false">a8b57adf-b67c-4853-979e-3b1b799e3d59</guid><category><![CDATA[Salesforce]]></category><category><![CDATA[admin]]></category><dc:creator><![CDATA[Samba]]></dc:creator><pubDate>Sun, 29 May 2016 09:14:00 GMT</pubDate><content:encoded><![CDATA[<p>接着上一篇我们继续往下讲。</p>

<h2 id="liveagentconfigurations">第六步: 设置 Live Agent Configurations</h2>

<p>Live Agent configurations 可以为你定制一个有效的 Agent，并且提供了监视 Agent 和 Customer 聊天的功能。</p>

<ul>
<li>单击 Setup, 在 Quick Find 搜索中输入 Live Agent Configurations，然后选择 <strong>Live Agent Configurations</strong>。</li>
<li>Click New。</li>
<li>在 Live Agent Configuration 的 Name 处输入 WeChat Agent Configuration。</li>
<li>勾选 Sneak Peek Enable, Request Sound Enabled, Disconnect Sound Enabled, Notifications Enabled。
<ul><li><strong>Sneak Peek Enable</strong> - Customer 在发送信息之前 Agent 可以查看发送的信息。</li>
<li><strong>Request Sound Enabled</strong> - 当 Agent 被分配到一个新的信息时，会有一个声音来提示 Agent。</li>
<li><strong>Disconnect Sound Enabled</strong> - 断开连接时的提示音。</li>
<li><strong>Notifications Enabled</strong> - 为正在进入的 Chats，会在桌面浏览器进行通知。仅仅支持某些浏览器。</li></ul></li>
<li>Custom Agent Name 里输入 WeChat Agent。</li>
<li>在 Auto Greeting 中输入 <em>Hello {!LiveAgent_VisitorName}, my name is {!User_FirstName} how can I help you today?</em></li>
<li>勾选 Auto Away on Decline。</li>
<li><p>Critical Wait Alert Time (seconds) 中输入 45。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-2-1-2.png" width="700px"></p></li>
<li><p>分配 Users 和 Profiles。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-2-2.png" alt=""></p></li>
<li><p>在Supervisor Settings 区域，设置如下。</p>

<ul><li><strong>Chat monitoring</strong> — 监视主管可以监视 Agent 和 Customer 的实时聊天。</li>
<li><strong>Whisper messages</strong> — 监视主管可以监视 Customer 发送的一些隐私给 Agent。</li>
<li><strong>Agent sneak peek</strong>— 当 Agent 发送一些信息的前，监视主管可以先查看。
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-2-3-1.png" alt=""></li></ul></li>
<li><p>单击 Save。</p></li>
</ul>

<h2 id="chatdeployments">第七步: 创建 Chat Deployments</h2>

<p>Chat Deployments 功能可以把定制好的 Live Agent 生成代码并发布到你公司的网站中。</p>

<ul>
<li>单击 Setup, 在 Quick Find 搜索中输入 Deployments，然后选择 <strong>Deployments</strong>。</li>
<li>Click New。</li>
<li>Live Chat Deployment Name 中输入 Deploy for the WeChat。</li>
<li>Chat Window Title 中输入 Welcome to the WeChat Support。</li>
<li>勾选允许访问者保存记录。</li>
<li>这里我们跳过 Chat Window Branding 部分直接单击 Save.</li>
</ul>

<p>Salesforce generates the deployment code。 <br>
<img src="http://blog.meginfo.com.cn/content/images/2016/05/Live-Agent-2-4-1.png" width="700px"></p>

<ul>
<li>拷贝和粘贴上面的代码到之前创建的记事本中，以备后用。</li>
</ul>

<h2 id="">结语</h2>

<p>到目前为止我们已经准备好了可以使用的代码，在下一章中我们将讲解如何在你的网站中使用这些代码。</p>]]></content:encoded></item></channel></rss>