Sunday, April 14, 2013

Google's changing focus

Recently Google announced that it is pulling the plug on Google Reader on July 1st 2013.  It was a weird feeling I was reading about this in Google Reader itself.  I've been using Google Reader since past 4 years regularly.  I feel this is one tool that Google has produced that is simple, easy to use and meets the needs.

From Google's perspective I totally get it why they want to go away from Google Reader.

  • It is not an effective advertising revenue generator
  • Is not as "Social" as Google+
  • Standalone product and does not integrate with other Google's ecosystem 
  • Does not serve Google's enterprise push:  Google's focus is not on its enterprise than regular common users as its add revenue has reached a crest

Monday, February 4, 2013

Apex Mobile User License Explained

Last week, I was looking at the org. license details of one of our customers who wanted to see if they can use the mobile license.  They did not have mobile licenses or purchased any.  While looking Company Profile section of the Setup, I found that they had "Apex Mobile User" Licenses.  As this does not explain the difference between "Apex Mobile User" and "Salesforce Mobile" licenses, I contacted Salesforce and got a very clear and conscience explanation of these different type licenses

Apparently I was informed by SFDC that "Apex Mobile User" and "Salesforce Mobile" licenses are the one and same.  Apex Mobile User License have full support of mobile features of Salesforce.  This license can work on Visualforce, Page Layouts, Standard or Custom object of Salesforce.  Each users will have to enabled explicitly to enable them for mobile devices.

So, now that the customer has Apex Mobile licenses, their team can leverage these features.


Sunday, September 2, 2012

Working with JPlayer and Visualforce

I recently came across a need to have audio on a Visualforce pages.  While embedding a flash based audio would be easy enough to do, it would not solve the purpose as flash is not universal and compatible across.  I started off with HTML5 audio tag.

<audio> tag makes the life of a developer easy.  I tested in Firefox, Chrome and Safari and it was working grand.  Now comes the bummer IE9.  Even though it is written everywhere that IE9 supports audio tag, there is a catch.  IE9 supports only the events of Audio tag but no direct support as other browsers provide.  Moreover the older version of IE (IE8 and IE7) do not support so in a way there is no way you can use audio tag yet considering IE is still one the most users browsers in the market.

Other than the standard browser support, the VF page also had to work on mobile platforms.  jPlayer is on of the most widely used jQuery plugin that addresses this very issue of compatiblity at the same time providing a very nice UI elements to manipulate

Here is the visual force example of using jPlayer plugin with jQuery to make the pages audio enabled.  jPlayer provides nice documentation for events and properties of the plugin



1:  <!DOCTYPE html>  
2:  <apex:page showHeader="false" standardStylesheets="false" >  
3:    <head>  
4:    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
5:    <apex:includeScript value="{!$Resource.jQuery14}" />  
6:    <apex:includeScript value="{!URLFOR($Resource.jPlayer,'jPlayer/js/jquery.jplayer.min.js')}"></apex:includeScript>  
7:    <apex:stylesheet value="{!URLFOR($Resource.jPlayer,'jPlayer/skin/blue.monday/jplayer.blue.monday.css')}"></apex:stylesheet>  
8:    <script type="text/javascript">  
9:      $(document).ready(function(){  
10:        alert(this.internal.flash.id);  
11:        $("#jquery_jplayer_1").jPlayer({  
12:          ready: function () {  
13:            $(this).jPlayer("setMedia", {  
14:              mp3:"{!$Resource.Q00000001mp3}",  
15:              oga:"{!$Resource.Q00000001ogg}"  
16:            }).jPlayer("play");  
17:          },  
18:          swfPath: "{!URLFOR($Resource.jPlayer,'jPlayer/js')}",  
19:          supplied: "mp3, oga",  
20:          solution: "flash, html",  
21:          wmode: "window"  
22:        });  
23:      });  
24:    </script>  
25:    </head>  
26:    <body>  
27:      <div id="jquery_jplayer_1" class="jp-jplayer"></div>  
28:      <div id="jp_container_1" class="jp-audio">  
29:        <div class="jp-type-single">  
30:          <div class="jp-gui jp-interface">  
31:            <ul class="jp-controls">  
32:              <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>  
33:              <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>  
34:              <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>  
35:              <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>  
36:              <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>  
37:              <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>  
38:            </ul>  
39:            <div class="jp-progress">  
40:              <div class="jp-seek-bar">  
41:                <div class="jp-play-bar"></div>  
42:              </div>  
43:            </div>  
44:            <div class="jp-volume-bar">  
45:              <div class="jp-volume-bar-value"></div>  
46:            </div>  
47:            <div class="jp-time-holder">  
48:              <div class="jp-current-time"></div>  
49:              <div class="jp-duration"></div>  
50:              <ul class="jp-toggles">  
51:                <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>  
52:                <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>  
53:              </ul>  
54:            </div>  
55:          </div>  
56:          <div class="jp-title">  
57:            <ul>  
58:              <li>Cro Magnon Man</li>  
59:            </ul>  
60:          </div>  
61:          <div class="jp-no-solution">  
62:            <span>Update Required</span>  
63:            To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.  
64:          </div>  
65:        </div>  
66:      </div>  
67:    </body>  
68:  </apex:page>  

Monday, August 20, 2012

Working with 10 KB restriction with Portal Header and Footer

One of the restrictions (out of hundreds!) the Force.com platform places on Portal (Customer/Partner) is the footer and header size cannot be more than 10 KB.  While this may help to increase the speed at the same time, it inhibits the custom long headers and footers that some customers have.

One of the work arounds this issue is to minify the HTML, JavaScript and CSS that is there in the headers.  It really reduced the size of the Headers and Footers.  Will Peavy created this beautiful page to  minify HTML and all of its content.  The note of caution is see that the jQuery/JavaScript is well formed otherwise it becomes very difficult to debug.

Thursday, August 16, 2012

Authorization Issue with Sites on Force.com

One of the most annoying things in any development is authorization errors.  The problem multiplies itself when there is no stack trace on where the authorization errors are coming.  Last couple of days we ran into a bunch of Unauthorized errors while accessing, Visualforce pages on public sites.

Today finally was able find the root cause.  The issue was one of the columns referred in the SOQL belongs to the parent object and the object did not have access

Since, Salesforce does not display any error or where exactly this issue is here are few ways I think would help you to quickly identify the root cause


  • Enable debugging for the sites users
  • Check the debug logs and look for the log just before the authorization error
  • Go to the bottom of the log and trace back the code
    • One of the easier ways to find the issue is to add debug statements at different points where you think the most probable cause of failure could be
  • Check of the statement that last executed
  • Verify if the statement is the last statement in the method (apex code)
  • If you don't see that it is the last statement, then the failure just occurred at the statement
  • If the issue is with the SOQL, see that the columns being queried in the SOQL have access to the Force.com sites

Hopefully these steps will expedite the authorization issues you would encounter.  Let me know if you  found variations of this issue

Tuesday, August 14, 2012

Static resources on Force.com

One of the interesting things I ran into today while making customer portal pages look like another external web-site using static resources


  •  use timestamp in the resource url
    • For example if you are using static resources in a zip file (one of the best practices for maintaining static resources) use timestamp in the URL  /resources/id/timestamp/<filepath>
If you don't use this method to access, you may see a delay in the resources getting reflected by Salesforce Content Delivery network.

The other idea may be to use Amazon CDN which would make the page load quicker

Sunday, August 12, 2012

One of my best Bike Rides


This Saturday Prthika and I were able stretch a bit to do a 26 mile bike ride along W & OD trail.  It was a refresher.  I've been doing 10-20 miles but this one was special.





Find more Bike Ride in Tysons Corner, VA