<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cathylopez.com &#187; Salesforce.com</title>
	<atom:link href="http://cathylopez.com/category/salesforce/feed/" rel="self" type="application/rss+xml" />
	<link>http://cathylopez.com</link>
	<description>sharing some random thoughts</description>
	<lastBuildDate>Fri, 07 May 2010 01:36:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Invoking Apex from a Custom Button using a Visualforce Page</title>
		<link>http://cathylopez.com/2010/02/22/invoke-apex-from-custom-button-using-visualforce-page/</link>
		<comments>http://cathylopez.com/2010/02/22/invoke-apex-from-custom-button-using-visualforce-page/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:42:57 +0000</pubDate>
		<dc:creator>cathy</dc:creator>
				<category><![CDATA[Salesforce.com]]></category>
		<category><![CDATA[APEX]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[SControl]]></category>
		<category><![CDATA[Visual Force page]]></category>

		<guid isPermaLink="false">http://cathylopez.com/?p=124</guid>
		<description><![CDATA[
This post is about creating a custom button to be placed in a detail page using Visualforce page instead of an S-control (deprecated). I will be using Opportunity object for this example.
The Controller:

public class VFController
&#123;
    private final ApexPages.StandardController theController;
    public List&#38;lt;Opportunity&#38;gt; listOpps = new List&#38;lt;Opportunity&#38;gt;&#40;&#41;;
&#160;
    public [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gagabux.com/register.php/melchisholm22.html" target="_blank"><img src="http://gagabux.com/themes/GeN3/images/banner4.gif" alt="" align="center" /></a></p>
<p>This post is about creating a custom button to be placed in a detail page using Visualforce page instead of an S-control (deprecated). I will be using Opportunity object for this example.</p>
<p><strong>The Controller:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> VFController
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> ApexPages.<span style="color: #006633;">StandardController</span> theController<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>Opportunity<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> listOpps <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>Opportunity<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> VFController<span style="color: #009900;">&#40;</span>ApexPages.<span style="color: #006633;">StandardController</span> stdController<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
          theController <span style="color: #339933;">=</span> stdController<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Code we will invoke on page load.</span>
    <span style="color: #000000; font-weight: bold;">public</span> PageReference autoRun<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Opportunity opp<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>select id, name from Opportunity where id <span style="color: #339933;">=:</span>theController.<span style="color: #006633;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
	        opp.<span style="color: #003399;">Name</span> <span style="color: #339933;">=</span> opp.<span style="color: #006633;">name</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">' test'</span><span style="color: #339933;">;</span>
                listOpps.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>opp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
		Database.<span style="color: #006633;">update</span><span style="color: #009900;">&#40;</span>listOpps<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> theController.<span style="color: #006633;">view</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setRedirect</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>The Visualforce Page:</strong></p>
<p>You don&#8217;t need to do anything special here. The most important part here is the parameter <strong><em>action = &#8220;{!autoRun}&#8221;.</em></strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;apex:page</span> <span style="color: #000066;">standardController</span>=<span style="color: #ff0000;">&quot;Opportunity&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">extensions</span>=<span style="color: #ff0000;">&quot;VFController&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;{!autoRun}&quot;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;apex:sectionHeader</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Invoking Apex from a Button&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;apex:outputPanel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
You shoudn't see this page...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/apex:outputPanel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/apex:page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>After that, go to <strong>Setup &#8211;> App Setup &#8211;> Customize &#8211;> Opportunities &#8211;> Buttons and Links</strong>. Add a new custom button with the following configuration.</p>
<p><a href="http://cathylopez.com/wp-content/uploads/2010/02/custom-button21.jpg"><img class="size-full wp-image-138 alignnone" title="custom-button2" src="http://cathylopez.com/wp-content/uploads/2010/02/custom-button21.jpg" alt="" width="409" height="196" /></a></p>
<p>This example simply appends &#8220;test&#8221; to the Opportunity name when you click on that custom button. This is only to show you that it works. Hope this helps. <img src='http://cathylopez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://cathylopez.com/2010/02/22/invoke-apex-from-custom-button-using-visualforce-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch Update SObject in Salesforce.Com (VB.Net)</title>
		<link>http://cathylopez.com/2009/05/19/batch-update-sobject-in-salesforcecom-vbnet/</link>
		<comments>http://cathylopez.com/2009/05/19/batch-update-sobject-in-salesforcecom-vbnet/#comments</comments>
		<pubDate>Mon, 18 May 2009 16:04:53 +0000</pubDate>
		<dc:creator>cathy</dc:creator>
				<category><![CDATA[Salesforce.com]]></category>
		<category><![CDATA[API calls]]></category>
		<category><![CDATA[batch update]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[sObject]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://cathylopez.com/?p=90</guid>
		<description><![CDATA[
I&#8217;m sharing this code because I know a lot of new salesforce developers are pulling their hair out looking for concrete samples on how to do API batch update. Yes it took me awhile to be able to solve this problem. APEX API documentation doesn&#8217;t give it all and it&#8217;s frustrating&#8230;
So much for that, here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img title="salesforcedice" src="http://cathylopez.com/wp-content/uploads/2009/05/salesforcedice.jpg" alt="salesforce dice" width="105" height="100" align="right" /></p>
<p>I&#8217;m sharing this code because I know a lot of new salesforce developers are pulling their hair out looking for concrete samples on how to do API batch update. Yes it took me awhile to be able to solve this problem. APEX API documentation doesn&#8217;t give it all and it&#8217;s frustrating&#8230;</p>
<p>So much for that, here&#8217;s how I did it. My sample is updating a custom field in Opportunity Object using VB.Net.<br />
<br /><script type="text/javascript"><!--
google_ad_client = "pub-3719025517760366";
google_ad_slot = "9581001184";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br /></p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Dim</span> arrUpdateID <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> ArrayList  <span style="color: #008080; font-style: italic;">'This ArrayList holds the Opportunity IDs I need to update, I didn't included the query - that will be your task</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> objOppx<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">199</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> Opportunity
&nbsp;
<span style="color: #FF8000;">For</span> d <span style="color: #008000;">=</span> d <span style="color: #FF8000;">To</span> arrUpdateID.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> updateOppx <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Opportunity
&nbsp;
updateOppx.<span style="color: #0000FF;">Id</span> <span style="color: #008000;">=</span> arrUpdateID<span style="color: #000000;">&#40;</span>d<span style="color: #000000;">&#41;</span> <span style="color: #008080; font-style: italic;">' You need an ID when you update</span>
updateOppx.<span style="color: #0000FF;">Downloaded__c</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span> <span style="color: #008080; font-style: italic;">' This is a checkbox in SFDC where I'm setting it to true</span>
updateOppx.<span style="color: #0000FF;">Downloaded__cSpecified</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span> <span style="color: #008080; font-style: italic;">' This is required when updating a boolean field</span>
objOppx<span style="color: #000000;">&#40;</span>d<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> updateOppx <span style="color: #008080; font-style: italic;">' Storing opportunity values to  objOppx which is an array of Oppty</span>
&nbsp;
<span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> sr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> SaveResult <span style="color: #008000;">=</span> sfdc.<span style="color: #0000FF;">update</span><span style="color: #000000;">&#40;</span>objOppx<span style="color: #000000;">&#41;</span> <span style="color: #008080; font-style: italic;">' This is where the updating happens, this line of code should be outside the loop</span>
&nbsp;
<span style="color: #FF8000;">For</span> j <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> sr.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span>
<span style="color: #0600FF;">Dim</span> msgerr <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>
&nbsp;
<span style="color: #0600FF;">If</span> <span style="color: #804040;">Not</span> sr<span style="color: #000000;">&#40;</span>j<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">success</span> <span style="color: #FF8000;">Then</span>
msgerr <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Error updating Opportunity ID: &quot;</span> <span style="color: #008000;">+</span> sr<span style="color: #000000;">&#40;</span>j<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">id</span> <span style="color: #008000;">+</span> <span style="color: #808080;">&quot;. The error was: &quot;</span> _
<span style="color: #008000;">+</span> sr<span style="color: #000000;">&#40;</span>j<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">errors</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">message</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #FF8000;">Next</span></pre></div></div>

<p>Note: You can only update 200 records in an Object at a time due to Governor limits, so you need to make some work around with that issue. I have done that through chunking up my array of IDs to update. I&#8217;ll leave that up to you! <img src='http://cathylopez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I hope this post helps! There will be more to come as I learn Salesforce.com and APEX programming.</p>
<p>Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://cathylopez.com/2009/05/19/batch-update-sobject-in-salesforcecom-vbnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>May the Force Be With Me</title>
		<link>http://cathylopez.com/2009/05/13/may-the-force-be-with-me/</link>
		<comments>http://cathylopez.com/2009/05/13/may-the-force-be-with-me/#comments</comments>
		<pubDate>Tue, 12 May 2009 16:20:30 +0000</pubDate>
		<dc:creator>cathy</dc:creator>
				<category><![CDATA[Salesforce.com]]></category>
		<category><![CDATA[force.com]]></category>
		<category><![CDATA[salesforce logo]]></category>
		<category><![CDATA[salesforce.com]]></category>

		<guid isPermaLink="false">http://cathylopez.com/?p=84</guid>
		<description><![CDATA[Yes, I&#8217;m one of them now! I&#8217;m now part of the leader in Customer Relationship Management (CRM) &#38; Cloud Computing&#8230;Salesforce.Com!

]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-85" title="salesforce-logo" src="http://cathylopez.com/wp-content/uploads/2009/05/salesforce-logo.png" alt="salesforce-logo" width="191" height="202" />Yes, I&#8217;m one of them now! I&#8217;m now part of the leader in Customer Relationship Management (CRM) &amp; Cloud Computing&#8230;<a href="http://www.salesforce.com/">Salesforce.Com!</a></p>
<p><object width="560" height="340" data="http://www.youtube.com/v/ae_DKNwK_ms&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ae_DKNwK_ms&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://cathylopez.com/2009/05/13/may-the-force-be-with-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
