<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7079334966587984661</id><updated>2025-03-25T08:13:01.651+05:30</updated><category term="Salesforce Apex"/><category term="Visualforce"/><category term="Salesforce Tech Watch"/><category term="Salesforce Configuration"/><category term="Tooling API"/><category term="JavaScript"/><category term="Salesforce SOQL"/><title type='text'>Salesforce Implementations</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-436363857241006733</id><published>2014-09-01T11:43:00.000+05:30</published><updated>2014-09-01T11:52:28.359+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visualforce"/><title type='text'>Dynamic Component with Rerender issue</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #555555; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial; font-size: 14px;&quot;&gt;&lt;span style=&quot;font-family: verdana, geneva, sans-serif;&quot;&gt;&lt;b&gt;Issue:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dynamic Visualforce Component feature causing  issues with reRender if the component being reRendered , because of this we will loose the values which was filled in that section in case if we refresh the same section based on Ajax action.&lt;br /&gt;
&lt;br /&gt;
I hope even though if we are using dynamic visualforce components we should have the view state in the partial refresh. Dynamic in the sense is not only just displaying the components on the fly, along with that we should have all the platform features available but we are not getting those. To hold the old values in case of AJAX rerendering we should have our own way of scripting which is bizarre. &lt;br /&gt;
&lt;br /&gt;
I hope salesforce is not doing the dynamic components really dynamic, we should right our own scripts to hold the old values in case of new section creations using dyaminc components feature......&lt;br /&gt;
&lt;br /&gt;
I did my own way of scripting to hold the values and happy to share the solution incase if any one in need.&lt;br /&gt;
&lt;br /&gt;
Here is the information from salesforce&lt;span style=&quot;background-color: white; color: #555555; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial; font-size: 13.333333969116211px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;a href=&quot;http://help.salesforce.com/apex/HTViewSolution?id=000170864&amp;amp;language=en_US&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;http://help.salesforce.com/apex/HTViewSolution?id=000170864&amp;amp;language=en_US&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #555555; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial; font-size: 13.333333969116211px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: Helvetica Neue, Helvetica, Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #555555; font-family: Helvetica Neue, Helvetica, Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Thank you....&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: Helvetica Neue, Helvetica, Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/436363857241006733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/09/dynamic-component-with-rerender-issue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/436363857241006733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/436363857241006733'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/09/dynamic-component-with-rerender-issue.html' title='Dynamic Component with Rerender issue'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.594562699999983</georss:point><georss:box>12.4737417 76.946369199999978 13.4694557 78.242756199999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-5300096256199114340</id><published>2014-03-07T12:58:00.003+05:30</published><updated>2014-03-07T12:58:42.022+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Apex"/><category scheme="http://www.blogger.com/atom/ns#" term="Tooling API"/><title type='text'>Continued... Salesforce URL Hacking to Prepopulate Fields on a Standard Page Layout using Tooling API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here are the pros and cons using Tooling API in force.com development purpose. In my earlier post &lt;a href=&quot;http://salesforcewithkiran.blogspot.in/2014/03/salesforce-url-hacking-to-prepopulate.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&amp;nbsp;to get the CustomField Ids and auto populate some of the CustomObject field values on Standard layout I used Tooling API to get it done. But......&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
&lt;br /&gt;
1. This process won&#39;t work other Salesforce users apart from Admins or equivalent privileged users only. This is no where documented, but this API meant for external languages to build tools for force.com, in this way some what very clear that we should be careful while using these type of APIs.&lt;br /&gt;
&lt;br /&gt;
2. Only work with CustomFields on CustomObjects&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
&lt;br /&gt;
1. Not required to store the static CustomField Ids in a CustomSettings or CustomObject.&lt;br /&gt;
&lt;br /&gt;
2. Not required to hack the URL with static CustomField Ids.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So I did a work around as inserting the Tooling API information in a CustomObject so that I can use this CustomObject to fetch the fieldIds and auto populate the values for the same for Salesforce users who are not admins.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy coding.....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/5300096256199114340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/03/continued-salesforce-url-hacking-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/5300096256199114340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/5300096256199114340'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/03/continued-salesforce-url-hacking-to.html' title='Continued... Salesforce URL Hacking to Prepopulate Fields on a Standard Page Layout using Tooling API'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Bangalore, Karnataka, India</georss:featurename><georss:point>12.9715987 77.594562699999983</georss:point><georss:box>12.4737417 76.946369199999978 13.4694557 78.242756199999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-3026074664408920695</id><published>2014-03-04T13:02:00.000+05:30</published><updated>2014-03-07T13:00:50.584+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Apex"/><category scheme="http://www.blogger.com/atom/ns#" term="Tooling API"/><title type='text'>Salesforce URL Hacking to Prepopulate Fields on a Standard Page Layout using Tooling API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To build Salesforce URL’s to standard pages for creating records, that can be applied to Custom Buttons in order to pre-populate field values when a user clicks a button native using Tooling API.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tooling API support for Custom Object and Custom Fields&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This can query (REST or SOAP) the CustomObject and CustomField objects (which are not accessible via Apex SOQL).As we know every object in Salesforce has an ID and thia API has the means to obtain the custom field Id’s.&lt;br /&gt;
&lt;br /&gt;
We have &amp;nbsp;Apex wrapper for the Tooling API which can referred&amp;nbsp;&lt;a href=&quot;https://github.com/afawcett/apex-toolingapi/blob/master/apex-toolingapi/src/classes/ToolingAPIDemo.cls#L32&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I tried to use the REST and getting a CustomObject&#39;s CustomFields Ids by using the below approach..&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;This code is just my work according to my requirement and can be extended up to your requirements..&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
NOTE: This supports only for CustomObjects and CustomFields.&lt;br /&gt;
&lt;br /&gt;
To test this send the object name to the below method.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4409790039063px;&quot;&gt;&lt;code style=&quot;word-wrap: normal;&quot;&gt;FieldIdUtil.&lt;/code&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;findFieldIds(&#39;CustomObjectName&#39;) //Don&#39;t Append &#39;&quot;__c&quot; for example&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4409790039063px;&quot;&gt;&lt;pre style=&quot;border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; overflow: auto; padding: 0px; width: 646.4409790039063px;&quot;&gt;&lt;code style=&quot;word-wrap: normal;&quot;&gt;FieldIdUtil.&lt;/code&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;findFieldIds(&#39;Implementation&#39;) //Don&#39;t Append &#39;&quot;__c&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 12px;&quot;&gt;You should give the object name but not the API name&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
This method will return map of custom fields with the respective field IDs from which we can grab the fields what ever we want to pre-populate&lt;br /&gt;
&lt;br /&gt;
1. Consider the objectname is &#39;Implementation&#39; and the fields in this are &amp;nbsp;&#39;Field1&#39;, &#39;Field2&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ2ZkPo7xXL4FMHM-GXUIVU05kZw-U7mjtRFsueUAQ-BD6v4fo5_D2ouZ8EqnRG3MII2LgYrcztAmXSjIx1fE2-CVl6juDs8LIXkKI6Pd4MIEjQvZNx8-J7tZomNjy2wSHFT-tExZp0vxe/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  public class FieldIdUtil   
2:  {  
3:       public Static Map&amp;lt;String,String&amp;gt; fieldIdsMap = new Map&amp;lt;String,String&amp;gt;();  
4:       public Static String objectId; 
         
         public static List&lt;customapextype&gt; CustomApexTypes = new List&lt;customapextype&gt;();
 
 public class CustomApexType
        {
           public String Id;
           public String DeveloperName;
        }

5:       public static Map&amp;lt;String,String&amp;gt; findFieldIds(String ObjectName)   
6:    {  
7:         String objectIdQuery = &#39;Select Id From CustomObject Where DeveloperName = \&#39;&#39;+ObjectName+&#39;\&#39;&#39;;  
8:      sendCallout(objectIdQuery, true);  
9:      if(objectId != null)  
10:      {  
11:        String fieldIdsQuery = &#39;Select Id, DeveloperName From CustomField Where TableEnumOrId = \&#39;&#39;+objectId+&#39;\&#39;&#39;;  
12:        sendCallout(fieldIdsQuery, false);  
13:      }  
14:         return fieldIdsMap;  
15:       }  
16:       private static void sendCallout(String query, boolean flag)  
17:       {  
18:            String strIdValue,devName;  
19:            HttpRequest req = new HttpRequest();  
20:      req.setHeader(&#39;Authorization&#39;, &#39;Bearer &#39; + UserInfo.getSessionID());  
21:      req.setHeader(&#39;Content-Type&#39;, &#39;application/json&#39;);  
22:      String environmentURL =   
23:          URL.getSalesforceBaseUrl().toExternalForm() + &#39;/services/data/v28.0/tooling/query/?q=&#39; + EncodingUtil.urlEncode(query, &#39;UTF-8&#39;);  
24:      req.setEndpoint(environmentURL);  
25:      req.setMethod(&#39;GET&#39;);  
26:      Http h = new Http();  
27:      HttpResponse res = h.send(req);  
28:      JSONParser parser = JSON.createParser(res.getBody());  
29:      while (parser.nextToken() != null)
  {
      if ((parser.getText() == &#39;records&#39;))
      {
          parser.nextToken();
  
          CustomApexTypes = (List&amp;lt;CustomApexType&amp;gt;)parser.readValueAs(List&amp;lt;CustomApexType&amp;gt;.class);
      }
  }  
64:   }  
65:  }  
&lt;/customapextype&gt;&lt;/customapextype&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
The below code will generate the URL and the parameters from the above methods and do the redirect to a standard page by auto populate the specified values&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ2ZkPo7xXL4FMHM-GXUIVU05kZw-U7mjtRFsueUAQ-BD6v4fo5_D2ouZ8EqnRG3MII2LgYrcztAmXSjIx1fE2-CVl6juDs8LIXkKI6Pd4MIEjQvZNx8-J7tZomNjy2wSHFT-tExZp0vxe/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  public PageReference doredirect()  
2:    {  
3:         Map&amp;lt;String,String&amp;gt; fieldIdsMap = new Map&amp;lt;String,String&amp;gt;();  
4:          Set&amp;lt;String&amp;gt; fieldAPINames = new Set&amp;lt;String&amp;gt;  
5:        {&#39;Field1&#39;,&#39;Field2&#39;};  
8:         fieldIdsMap = FieldIdUtil.findFieldIds(&#39;Implementation&#39;);//Passing the custom object name  
9:         PageReference pr = new PageReference(URL.getSalesforceBaseUrl().toExternalForm() + &#39;/&#39; + Implementation__c.SObjectType.getDescribe().getKeyPrefix() + &#39;/e&#39;);  
10:         Map&amp;lt;String, String&amp;gt; params = pr.getParameters();  
           //we will be able to get the Master or Lookup id like this &#39;00N11000000GysA&#39; but inorder to refer in page we should add &quot;CF&quot;
            to the ID&quot;
11:         //params.put(&#39;CF00N11000000GysA&#39;, Opp.Name);  // if you have parent object like opportunity we need to do this bit
12:      //params.put(&#39;CF00N11000000GysA&#39; + &#39;_lkid&#39;, Opp.Id);  &lt;span style=&quot;font-family: arial; font-size: 12px;&quot;&gt;// if you have parent object like opportunity we need to do this bit&lt;/span&gt;

13:         for(String fieldAPIName : fieldAPINames)  
14:         {  
15:           params.put(fieldIdsMap.get(fieldAPIName), (String) Opp.get(fieldAPIName));  
16:            }  
17:         params.put(&#39;saveURL&#39;,opp.id);  
18:      params.put(&#39;retURL&#39;, opp.id);  
19:         pr.setRedirect(true);   
20:         system.debug(&#39;*************&#39; + pr);  
21:         return pr;  
22:    }  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;This is just my initial thoughts and worked solution for me ..There may be some changes and best practices you may found to change in this code....&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;a href=&quot;http://salesforcewithkiran.blogspot.in/2014/03/continued-salesforce-url-hacking-to.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&amp;nbsp;is my&amp;nbsp;experience in making this solution before taking to Production.&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/3026074664408920695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/03/salesforce-url-hacking-to-prepopulate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3026074664408920695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3026074664408920695'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2014/03/salesforce-url-hacking-to-prepopulate.html' title='Salesforce URL Hacking to Prepopulate Fields on a Standard Page Layout using Tooling API'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Bangalore, Karnataka, India</georss:featurename><georss:point>12.9715987 77.594562699999983</georss:point><georss:box>12.4737417 76.946369199999978 13.4694557 78.242756199999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-3848597362556957761</id><published>2013-09-27T17:26:00.000+05:30</published><updated>2013-10-07T11:28:21.733+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visualforce"/><title type='text'>Direct download an attachment from a link in Visualforce page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In many cases we need to download a file instead of opening the same.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;A simple HTML5 trick to do the same like below&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;cpp&quot; name=&quot;code&quot;&gt;&lt;apex:page standardController=&quot;attachment&quot; docType=&quot;html-5.0&quot;&gt;

&lt;a href=&quot;/servlet/servlet.FileDownload?file={!attachment.id}&quot; download=&quot;{!attachment.name}&quot;&gt;{!attachment.name}&lt;/a&gt;

&lt;!--&lt;apex:outputLink value=&quot;/servlet/servlet.fileDownload?file={!attachment.id}&quot;&gt;{!attachment.name}

    &lt;/apex:outputLink&gt;--&gt;(this will simply open the file)

 &lt;/apex:page&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
here main attributes are we should have docType=&quot;html-5.0&quot; and download=&quot;{!attachment.name}&quot; for the respective components as highlighted above...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here I used the standard controller you can construct the same using controllers/Extensions to achive the same.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy coding...........&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/3848597362556957761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/09/direct-download-attachment-from-link-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3848597362556957761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3848597362556957761'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/09/direct-download-attachment-from-link-in.html' title='Direct download an attachment from a link in Visualforce page'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-3254772024580369134</id><published>2013-08-21T11:36:00.000+05:30</published><updated>2013-08-21T11:36:04.008+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visualforce"/><title type='text'>Drop-down button in a Visualforce Page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
creating a drop-down button in a vf page..this is simple hack using standard salesforce styles&lt;br /&gt;
&lt;br /&gt;
Code:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;&amp;lt;apex:page&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;  &amp;lt;div class=&quot;menuButton&quot; id=&quot;MyMenu&quot;&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;    &amp;lt;div class=&quot;menuButtonButton&quot; id=&quot;MyMenuButton&quot;&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;       &amp;lt;span id=&quot;menuLabel&quot; tabindex=&quot;0&quot; style=&quot;&quot;&amp;gt;MyMenu&amp;lt;/span&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;    &amp;lt;div class=&quot;menuButtonMenu&quot; id=&quot;MyMenuMenu&quot;&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;      &amp;lt;a href=&quot;/&quot; class=&quot;menuButtonMenuLink firstMenuItem&quot;&amp;gt;Left VoiceMail&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;      &amp;lt;a href=&quot;/&quot; class=&quot;menuButtonMenuLink&quot;&amp;gt;Call in 1 day&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;&lt;pre class=&quot;codeBlock&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;      &amp;lt;a href=&quot;/&quot; class=&quot;menuButtonMenuLink&quot;&amp;gt;Call in 3 day&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;      &amp;lt;a href=&quot;/&quot; class=&quot;menuButtonMenuLink&quot;&amp;gt;Call in 5 day&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;codeBlock&quot; style=&quot;background-color: #f8f8f8; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;  &amp;lt;/div&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;new MenuButton(&#39;MyMenu&#39;, false);&amp;lt;/script&amp;gt;
  
&amp;lt;/apex:page&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
you can associate the actions by replacing the anchor tags with commandlinks or use ajax&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy coding.....&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/3254772024580369134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/08/drop-down-button-in-visualforce-page.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3254772024580369134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/3254772024580369134'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/08/drop-down-button-in-visualforce-page.html' title='Drop-down button in a Visualforce Page'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-880415418336192486</id><published>2013-08-02T12:47:00.002+05:30</published><updated>2013-08-02T12:52:31.654+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visualforce"/><title type='text'>Standard Salesforce DatePicker not working?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Some times Visualforce page with rerender sections, that standard DatePicker field based on Date or DateTime inputField tag was not working?&lt;br /&gt;
&lt;br /&gt;
This was happend to me recently when I am developing some vf page. For this, a small hack that we can use is&lt;br /&gt;
&lt;br /&gt;
if you have any field which is date or datetime, try to create the block which executes on every load with out and conditional renderings . This will allow to initialize the script and works for our custom inputField in vf page..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=”display:none”&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;apex:inputField value=“{!Account.Date_field__c}”/&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you don&#39;t have any field which is date or datetime on the standard controller then create a property for the extension if you have any(if not you may need to created a date field on the standard controlller..but this doesn&#39;t make sense...in order to cover an issue we are not supposed to create &amp;nbsp;field..) which contains a set up object date or datetime field and make use of the same. like&lt;br /&gt;
&lt;br /&gt;
public opportunity oppObj {get;set;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;apex:inputField value=&quot;{!oppObj.closeddate}&quot; rendered=&quot;false&quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hope this will help those we stuck with this kind of issue...Thank you.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/880415418336192486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/08/standard-salesforce-datepicker-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/880415418336192486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/880415418336192486'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/08/standard-salesforce-datepicker-not.html' title='Standard Salesforce DatePicker not working?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-8698354792381099371</id><published>2013-07-05T18:18:00.002+05:30</published><updated>2013-07-05T18:18:41.783+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Apex"/><title type='text'>Setting Id Fields on sObjects for Updates</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Starting with Apex code saved using Salesforce.com API version 27.0, the Id field is now writeable&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;list&amp;lt;Account&amp;gt; lstA = [select id,name from account limit 1];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Account a1 = new Account();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a1.id = lstA[0].id;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;a1.name = &#39;update through ID&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;update a1;&lt;br /&gt;
&lt;br /&gt;
but attempting to insert these sObject instances results in an error.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/8698354792381099371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/07/setting-id-fields-on-sobjects-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/8698354792381099371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/8698354792381099371'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/07/setting-id-fields-on-sobjects-for.html' title='Setting Id Fields on sObjects for Updates'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-6811664634653666182</id><published>2013-06-17T12:37:00.000+05:30</published><updated>2013-06-17T12:37:46.103+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>Extend the default Number object with a formatMoney() method</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
// usage: someVar.formatMoney(decimalPlaces, symbol, thousandsSeparator, decimalSeparator)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // defaults: (2, &quot;$&quot;, &quot;,&quot;, &quot;.&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Number.prototype.formatMoney = function(places, symbol, thousand, decimal) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; places = !isNaN(places = Math.abs(places)) ? places : 2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; symbol = symbol !== undefined ? symbol : &quot;$&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thousand = thousand || &quot;,&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; decimal = decimal || &quot;.&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var number = this,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; negative = number &amp;lt; 0 ? &quot;-&quot; : &quot;&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i = parseInt(number = Math.abs(+number || 0).toFixed(places), 10) + &quot;&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; j = (j = i.length) &amp;gt; 3 ? j % 3 : 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return symbol + negative + (j ? i.substr(0, j) + thousand : &quot;&quot;) + i.substr(j).replace(/(\d{3})(?=\d)/g, &quot;$1&quot; + thousand) + (places ? decimal + Math.abs(number - i).toFixed(places).slice(2) : &quot;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var n = new Number(12000);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.getElementById(&#39;{!$Component.lblMoney}&#39;).value=n.formatMoney(2, &quot;$&quot;, &quot;,&quot;, &quot;.&quot;);&lt;br /&gt;
&lt;br /&gt;
Some useful links: &amp;nbsp;&lt;a href=&quot;http://josscrowcroft.github.io/accounting.js/&quot;&gt;http://josscrowcroft.github.io/accounting.js/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/6811664634653666182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/06/extend-default-number-object-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/6811664634653666182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/6811664634653666182'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/06/extend-default-number-object-with.html' title='Extend the default Number object with a formatMoney() method'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-4214272194772370286</id><published>2013-06-04T21:32:00.004+05:30</published><updated>2013-06-05T10:50:12.802+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Tech Watch"/><title type='text'>Salesforce to Acquire ExactTarget</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Here is the info....&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dealbook.nytimes.com/2013/06/04/salesforce-to-buy-exacttarget-for-2-5-billion/?ref=technology&quot;&gt;http://dealbook.nytimes.com/2013/06/04/salesforce-to-buy-exacttarget-for-2-5-billion/?ref=technology&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/4214272194772370286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/06/salesforce-to-acquire-exacttarget.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/4214272194772370286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/4214272194772370286'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/06/salesforce-to-acquire-exacttarget.html' title='Salesforce to Acquire ExactTarget'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-165791821299576437</id><published>2013-05-27T15:48:00.000+05:30</published><updated>2013-06-05T10:50:46.497+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Tech Watch"/><title type='text'>Dreamforce #DF13</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
JOIN THE CUSTOMER COMPANY REVOLUTION --&amp;gt; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://www.salesforce.com/dreamforce/DF13/&quot; target=&quot;_blank&quot;&gt;DF13&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/165791821299576437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/dreamforce-df13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/165791821299576437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/165791821299576437'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/dreamforce-df13.html' title='Dreamforce #DF13'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-7510246934485366469</id><published>2013-05-24T10:57:00.000+05:30</published><updated>2013-05-24T10:57:08.856+05:30</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Google I/O keynote..amazingly&amp;nbsp;terrific.....&lt;br /&gt;
&lt;br /&gt;
Please watch here &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://www.youtube.com/watch?feature=player_embedded&amp;amp;v=9pmPa_KxsAM#!&quot;&gt;Google 2013 I/O keynote&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/7510246934485366469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/google-io-keynote.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7510246934485366469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7510246934485366469'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/google-io-keynote.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-7605595063436801518</id><published>2013-05-23T17:22:00.001+05:30</published><updated>2013-05-23T17:47:23.072+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Configuration"/><title type='text'>NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile issue in salesforce</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;This issue will generally come from spring13 release, when you refreshed a full sandbox and trying to send e-mails via Apex this may lead you to an issue saying that&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&quot;NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature&quot;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;To get rid of this issue&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;go to Administer &amp;gt; Email Administration &amp;gt; Deliverability and then you will have options to select like&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;No access,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;System email only,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;All email.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;select All email from the list.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;• No access: Prevents all outbound email to and from users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;• System email only: Allows only automatically generated emails, such as new user and password reset emails.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;• All email: Allows all types of outbound email. Default for new, non-sandbox organizations.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/7605595063436801518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/nomassmailpermission-single-email-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7605595063436801518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7605595063436801518'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/nomassmailpermission-single-email-is.html' title='NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile issue in salesforce'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-2797176226590260687</id><published>2013-05-13T14:42:00.002+05:30</published><updated>2013-05-13T14:55:01.209+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Apex"/><title type='text'>You have uncommitted work pending. Please commit or rollback before calling out issue workaround in salesforce</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;Sometimes we need to create a record and then update it with information provided&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;by a Web Service. However,a Web Service Callout may not occur after a DML statement&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;within the same transaction.To achieve the required action, the transaction must&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;be separated into two parts so that the DML transaction is completed before the&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;Web Service Callout occurs and one workaround like below&lt;/span&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;color:black&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14&lt;/pre&gt;&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:page&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;controller=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;WsCalloutTest&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;tabstyle=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Account&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:form&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:actionFunction&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;action=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;{!firstcall}&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;name=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;firstcall&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;Rerender=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;statuses&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;status=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Status1&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;oncomplete=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;WebServiceCall();&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:actionFunction&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;action=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;{!WebServiceCall}&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;name=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;WebServiceCall&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;status=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Status2&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;reRender=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;statuses, msg&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;statuses&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:actionStatus&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Status1&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;startText=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;...Inserting Record Into DB...&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:actionStatus&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Status2&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;startText=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;...Calling Web Service...&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;msg&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;apex:pageMessages&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;div&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;name=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;DoAction&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;class=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;btn&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;type=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;value=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Do Action&quot;&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;onclick=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;firstcall();return false;&quot;&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/apex:form&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/apex:page&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;color:black;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24&lt;/pre&gt;&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;WsCalloutTest&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    
    &lt;span style=&quot;color: black;&quot;&gt;Contact&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
   
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;PageReference&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;firstcall&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Contact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Test&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Contact&lt;/span&gt;&lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;insert&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;PageReference&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;WebServiceCall&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Execute a call to a Web Service&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;HttpRequest&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;req&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;HttpRequest&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;req&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setEndpoint&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: #f57900;&quot;&gt;http:&lt;/span&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;//yourserviceurl.com?id=&#39; + myContact.Id);&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;req&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setMethod&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;GET&lt;/span&gt;&lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;HttpResponse&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;response&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Http&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;send&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;req&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Test&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Contact&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;update&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;//if the update is successfull&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;ApexPages&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;addMessage&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ApexPages&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ApexPages&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Severity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;CONFIRM&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;WebService&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Called&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;on&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;Contact:&lt;/span&gt; &lt;span style=&quot;border: 1px solid #ef2929; color: #a40000;&quot;&gt;&#39;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;myContact&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;));&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/2797176226590260687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/you-have-uncommitted-work-pending.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/2797176226590260687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/2797176226590260687'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/you-have-uncommitted-work-pending.html' title='You have uncommitted work pending. Please commit or rollback before calling out issue workaround in salesforce'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-7016279991640784923</id><published>2013-05-02T17:48:00.000+05:30</published><updated>2013-05-07T12:04:00.575+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Apex"/><title type='text'>Number to Word conversion using Salesforce Apex</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;
pre.CICodeFormatter{
 font-family:arial;
 font-size:12px;
 border:1px dashed #CCCCCC;
 width:99%;
 height:auto;
 overflow:auto;
 background:#f0f0f0;
 line-height:20px;
 background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ2ZkPo7xXL4FMHM-GXUIVU05kZw-U7mjtRFsueUAQ-BD6v4fo5_D2ouZ8EqnRG3MII2LgYrcztAmXSjIx1fE2-CVl6juDs8LIXkKI6Pd4MIEjQvZNx8-J7tZomNjy2wSHFT-tExZp0vxe/s320/codebg.gif);
 padding:0px;
 color:#000000;
 text-align:left;
}
pre.CICodeFormatter code{
 color:#000000;
 word-wrap:normal;
}
&lt;/style&gt;&lt;br /&gt;
&lt;pre class=&quot;CICodeFormatter&quot; &gt;&lt;code class=&quot;CICodeFormatter&quot;&gt;1:  public with sharing class NumberToWord {  
2:      static String[] to_19 = new string[]{ &#39;zero&#39;, &#39;one&#39;,  &#39;two&#39;, &#39;three&#39;, &#39;four&#39;,  &#39;five&#39;,  &#39;six&#39;,  
3:      &#39;seven&#39;, &#39;eight&#39;, &#39;nine&#39;, &#39;ten&#39;,  &#39;eleven&#39;, &#39;twelve&#39;, &#39;thirteen&#39;,  
4:      &#39;fourteen&#39;, &#39;fifteen&#39;, &#39;sixteen&#39;, &#39;seventeen&#39;, &#39;eighteen&#39;, &#39;nineteen&#39; };  
5:    static String[] tens = new string[]{ &#39;twenty&#39;, &#39;thirty&#39;, &#39;forty&#39;, &#39;fifty&#39;, &#39;sixty&#39;, &#39;seventy&#39;, &#39;eighty&#39;, &#39;ninety&#39;};  
6:    static String[] denom = new string[]{ &#39;&#39;,  
7:      &#39;thousand&#39;,   &#39;million&#39;,     &#39;billion&#39;,    &#39;trillion&#39;,    &#39;quadrillion&#39;,  
8:      &#39;quintillion&#39;, &#39;s!xtillion&#39;,   &#39;septillion&#39;,  &#39;octillion&#39;,   &#39;nonillion&#39;,  
9:      &#39;decillion&#39;,  &#39;undecillion&#39;,   &#39;duodecillion&#39;, &#39;tredecillion&#39;,  &#39;quattuordecillion&#39;,  
10:      &#39;s!xdecillion&#39;, &#39;septendecillion&#39;, &#39;octodecillion&#39;, &#39;novemdecillion&#39;, &#39;vigintillion&#39; };  
11:    // convert a value &amp;lt; 100 to English.    
12:   public static String convert_nn(integer val) {  
13:      if (val &amp;lt; 20)  
14:        return to_19[val];  
15:      if(val == 100)  
16:          return &#39;One Hundred&#39;;  
17:      for (integer v = 0; v &amp;lt; tens.size(); v++) {  
18:        String dcap = tens[v];  
19:        integer dval = 20 + 10 * v;  
20:        if (dval + 10 &amp;gt; val) {  
21:          if (Math.Mod(val,10) != 0)  
22:            return dcap + &#39; &#39; + to_19[Math.Mod(val,10)];  
23:          return dcap;  
24:        }      
25:      }  
26:      return &#39;Should never get here, less than 100 failure&#39;;  
27:    }  
28:    // convert a value &amp;lt; 1000 to english, special cased because it is the level that kicks   
29:    // off the &amp;lt; 100 special case. The rest are more general. This also allows you to  
30:    // get strings in the form of &quot;forty-five hundred&quot; if called directly.  
31:    public static String convert_nnn(integer val) {  
32:      String word = &#39;&#39;;  
33:      integer rem = val / 100;  
34:      integer mod = Math.mod(val,100);  
35:      if (rem &amp;gt; 0) {  
36:        word = to_19[rem] + &#39; hundred&#39;;  
37:        if (mod &amp;gt; 0) {  
38:          word += &#39; &#39;;  
39:        }  
40:      }  
41:      if (mod &amp;gt; 0) {  
42:        word += convert_nn(mod);  
43:      }  
44:      return word;  
45:    }  
46:    public static String english_number(long val) {  
47:      if (val &amp;lt; 100) {  
48:        return convert_nn(val.intValue());  
49:      }  
50:      if (val &amp;lt; 1000) {  
51:        return convert_nnn(val.intValue());  
52:      }  
53:      for (integer v = 0; v &amp;lt; denom.size(); v++) {  
54:        integer didx = v - 1;  
55:        integer dval = (integer)Math.pow(1000, v);  
56:        if (dval &amp;gt; val) {  
57:          integer mod = (integer)Math.pow(1000, didx);  
58:          integer l = (integer) val / mod;  
59:          integer r = (integer) val - (l * mod);  
60:          String ret = convert_nnn(l) + &#39; &#39; + denom[didx];  
61:          if (r &amp;gt; 0) {  
62:            ret += &#39;, &#39; + english_number(r);  
63:          }  
64:          return ret;  
65:        }  
66:      }  
67:      return &#39;Should never get here, bottomed out in english_number&#39;;  
68:    }  
69:  }  
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;This will work for integer range values&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/7016279991640784923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/number-to-words-in-apex.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7016279991640784923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/7016279991640784923'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/05/number-to-words-in-apex.html' title='Number to Word conversion using Salesforce Apex'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-1908962656507770716</id><published>2013-04-24T12:24:00.000+05:30</published><updated>2013-05-07T15:19:26.052+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Tech Watch"/><title type='text'>Social.com</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;Today Salesforce announced new advertising service for social networks---&lt;/span&gt;&lt;a href=&quot;http://www.social.com/&quot; style=&quot;font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;www.social.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/1908962656507770716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/04/one-more-game-changing-service-coming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/1908962656507770716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/1908962656507770716'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2013/04/one-more-game-changing-service-coming.html' title='Social.com'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-418257655747097490</id><published>2011-04-14T17:16:00.000+05:30</published><updated>2013-05-07T12:03:19.808+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce Configuration"/><title type='text'>Field Label trick in Salesforce</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 13px; line-height: 15px;&quot;&gt;&amp;nbsp;If you insert &amp;lt;br&amp;gt; into a field name, it will insert a return on the name making it two lines. This solves a long standing irritation list views where there was a long label, but short content.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/418257655747097490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2011/04/reg-field-label.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/418257655747097490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/418257655747097490'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2011/04/reg-field-label.html' title='Field Label trick in Salesforce'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7079334966587984661.post-1613446507138736521</id><published>2011-04-13T23:08:00.000+05:30</published><updated>2013-05-07T12:50:54.545+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Salesforce SOQL"/><title type='text'>Comparing object field values in the WHERE clause in Salesforce</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;&quot;&gt;&lt;b&gt;SOQL does not currently support comparing same object field values in the WHERE clause, but there&#39;s simple workaround&lt;br /&gt;
&lt;br /&gt;
First, create a formula field Flag__c on the SObject that performs the same comparison function as the desired WHERE clause.&lt;br /&gt;
IF (OwnerId == CreatedById, &quot;true&quot;, &quot;false&quot;)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://salesforcewithkiran.blogspot.com/feeds/1613446507138736521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://salesforcewithkiran.blogspot.com/2011/04/soql-does-not-currently-support.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/1613446507138736521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7079334966587984661/posts/default/1613446507138736521'/><link rel='alternate' type='text/html' href='http://salesforcewithkiran.blogspot.com/2011/04/soql-does-not-currently-support.html' title='Comparing object field values in the WHERE clause in Salesforce'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01166046664395889772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>