Thursday, 24 July 2014

Adding a picture to a record in Salesforce

The concept of "Profile pictures" is pretty common these days, and default pictures of products or locations are standard fare for most CMS systems and websites. Getting a default picture displayed directly on a Salesforce record can be a little tricky. In this blog post I am going to talk through how I added my own, user manageable contact picture directly on the Contact record page (but you can re-purpose it however you like to other object types).

[Incidentally I am aware of Social-Contact settings, but more often than not this doesn't provide a "suitable" photo of a contact - my facebook picture certainly isn't! - and it only works for Accounts and Contacts of course]

Here is the goal we are after then:


You can see the cool picture associated with the Contact there, and a button to "Upload new photo". Lets walk through the other cool functions of this simple feature, and then I'll tell you how I did it (copy-pastas can just scroll down for the code snippets).

When you first create/arrive at a contact page without a picture, you are presented with this:


Clicking the "Upload photo" button presents this standard form:


Which in turn allows a user to select a local file and "Save" it to the Salesforce record. Now whenever they view the record, they will be presented with this photo, and a button to overwrite this file with a new photo, which takes them via the same form as above.

The process actually taken here is that the form uploads a file to the "Notes and Attachments" of the record, with a specific filename (set in the Controller). The controller is careful to make sure there is only ever one of these files (in the obscure case another file is added manually, the first is retrieved by the page, and next time the profile picture is updated, it will clear out all spurious files)


By doing this, we don't need any new "rich text fields" on our record, or indeed anything more complicated than a Visualforce snippet and Apex Controller extension.

The visualforce page:


<apex:page standardController="Contact" extensions="ContactPhotoUploadController" showHeader="false" standardStyleSheets="true" sidebar="false">

<apex:form id="contentForm">
<div style="height:170px;">
    <apex:pageBlock mode="maindetail">
    
        <apex:pageblocksection columns="1" rendered="{!displaying}">
            <apex:image height="150" value="{!URLFOR($Action.Attachment.Download, currentPicture)}" rendered="{!currentPicture != null}"/>
            <apex:outputPanel rendered="{!currentPicture == null}"><em>No picture currently available</em></apex:outputPanel>
        </apex:pageblocksection>
        
        <apex:pageblocksection columns="1" rendered="{! !displaying}">
            <p>Use the button to below to select a new file and then press "Save"</p>
            <apex:inputFile value="{!profilePicFile}" />
            <p>Or press Cancel to return.</p>
        </apex:pageBlockSection>
        
    </apex:pageBlock>
</div>
    <apex:commandButton value="Upload new photo" action="{!toggle}" rerender="contentForm" rendered="{!displaying && currentPicture!=null}"/>
    <apex:commandButton value="Upload photo" action="{!toggle}" rerender="contentForm" rendered="{!displaying && currentPicture==null}"/>
    <apex:commandButton value="Cancel" action="{!toggle}" rendered="{! !displaying}"/>
    <apex:commandButton value="Save" action="{!saveFile}" rendered="{! !displaying}"/>
</apex:form>
  
</apex:page>

This handles the display (or not) of the picture, form and relevant buttons.. and also sets the height that we will be working with (which is relevant when we come to add this to the page layout in a second).

Here is the controller extension that facilitates the uploading of the file and retrieving it when the page is loaded:
public with sharing class ContactPhotoUploadController {

    Private Static FINAL String fixedFileName = 'profilePhoto.jpg';

    public boolean displaying { get; set; }
    public Contact pageContact;
    public Blob profilePicFile { get; set; }
    public Id currentPicture { get; set; }
    
    /** Constructor, grab record, and check/load an existing photo */
    public ContactPhotoUploadController(ApexPages.StandardController controller) {
        pageContact = (Contact)controller.getRecord();
        
        List<attachment> currentPictures = [SELECT Id FROM Attachment WHERE parentId = :pageContact.Id AND name = :fixedFileName LIMIT 1];
        if(currentPictures.size() != 0) {
            currentPicture = currentPictures.get(0).Id;
        }
        
        displaying = true;
    }

    /** toggle switches between the photo display and photo upload form */
    public void toggle() {
        displaying = !displaying;
    }
    
    /** saveFile clears any existing profile picture, retrieves the data from the form, and saves it under the relevant filename*/
    Public Pagereference saveFile() {

        // first, we cannot have any conflicting files
        List<attachment> savedPicture = [SELECT Id, name, body FROM Attachment WHERE parentId = :pageContact.Id AND name = :fixedFileName];
        if(savedPicture.size() > 0) {
            delete savedPicture;
        }
       
        // Now, we save the new blob
        Attachment a = new Attachment(parentId = pageContact.Id, name = fixedFileName, body = profilePicFile);
        insert a;
        
        currentPicture = a.Id;
        
        displaying = true;
        return null;
    }
    

}

Once you have this basic Visualforce page up and running, all you need to do is go over and configure your Contact (in this case) Page Layout, and add the Visualforce page to the screen, and set it to a height of 30px greater than the style height of the div - this is to fit the buttons in underneath.



Boom, there you go, now users can add and edit a default photo on any kind of record page (you just need to tweak the controller to use the standard controller of another object).

Please note, in this blog post example I have neglected to address any kind of permissions or security considerations.. so remember if you decide to implement this to think about which users should be able to load, or upload photos to records. That's the kind of rich, useful developer love you would get from a Desynit based implementation ;-)

If you have any queries about this, or would like a complete implementation of this brought to your Salesforce org. Please don't hesitate to get in touch with me directly, or give Desynit a call and we can sort you out!

Wednesday, 9 July 2014

Salesforce Summer is here!

Summer is almost upon us, and I don't just mean that every now and then the rain stops over here in England, I mean in just a couple of weeks the Salesforce release cycle will turn another notch, and one-by-one, all of our Salesforce instances will be the eager recipient of a whole flurry of new and exciting features. So we get to stare up and down the setup menu for the intreging little "New!" text next to menu items, and then spend a whole afternoon exploring the brilliant things to see and do.


If you want to find out everything there is to know about the coming release, I can recommend you read the Salesforce Summer'14 Release Notes - but seeing as they are 340 pages long, and you might have a busy day lined up ahead of you, let me take you though some of the most interesting bits from my point of view.

Incidentally, the release dates for each org are available on the Salesforce Trust Scheduled Maintenance page and you should be getting the white prompt page forewarning you of your instance update now when you log in.


So, first of all, I think we need to look at the most important aspect of the new release, because it is a feature that will affect many of us every day, many times a day.

It's the new logo.

It's a Snorkel. I Love it!

But moving on.


The key developer changes to my project work in this Salesforce Release are:

Longer text fields - The maximum length of Long and Rich Text fields has been increased from 32,768 to 131,072 characters - they still defaults to the usual length, and existing fields will not be changed. Exciting times for super-verbose users.

More lookups and external IDs  - Salesforce are always happy to deliver bigger limits as soon as the technology and hardware facilitates it, and it seems that with Summer'14 the database layer is able to deliver more capacity for relationships and external IDs (which, of course, means more indexes) so you can now have 40 (instead of 25) relationships and 7 (instead of 3) external IDs.

THREE TIMES THE API CALLS - Sorry, I had to shout that one. At least twice in recent memory, I have seen a developer edition max out it's API calls in 24 hours and seen said developer skulk off to the pub coffee shop because they can no longer work. Especially when the Developer Console was ridiculously API hungry, or someone was running tests from Sublime Text. Well, now they can work three times as long, because Developer Editions now get 15,000 API calls instead of the old 5,000.



Improved Setup search -  lets you directly search for custom objects and fields in the Setup menu search, saving us all that time going through "Create > Objects > ObjectName > Scrollscrollscroll"

Publisher Actions for Chatter Off Organisations - This is a common one for me, we have a lot of clients who are yet to accept the leap to enabling Chatter in their organisation. Before now this meant a lot of Salesforce1 and the incredible power of Publisher Actions was denied to them as well. Not any more! Publisher actions to directly update records straight from the button are now available to those businesses.

Proper find in the Developer Console - At last, a proper find, find next and find/replace tool will be available in the developer console! And even better, real search "across all files" will let you find that snippet of code you can't remember where you put it. They are also releasing the ability to re-format your indentation properly, but as a legitimate developer, I always indent my work correctly first time, every time... (yeahright). You can get to all of this through a new "Edit" menu item appearing soon.

No limit on the Describe methods - Did I mention Salesforce like to smash down their own governor limits? Well, here's another one for the scrap heap. Take a quick look at this search result page on the Salesforce Stack Exchange and you will see that people have been battling with this ceiling for a little while now. So... should we get a SFSE moderator to just delete all these questions now?! :D

Full name functionality - Found that you add a custom field "Middle name" to Contact for every other human-contact-heavy client case? Well, now (via a switch on from Salesforce) this is a standard field for Lead, Contact and Account sObjects (it is also on the Name and User objects).

...and that's just the big stuff...

 In the whole new domain of mobile applications, developers will see awesome new features in both SalesforceA and Salesforce1. I noticed for Spring'14 the Developer Certification now recommends you go through the mobile release training materials too, because the Salesforce1 Mobile App is not just a bolt on, or a piece of configuration, it is it's entirely own development suite now. My user highlight for Salesforce1 this release is Approval processes - Just like with change sets, approval processes are always rocking up to the party a little bit late, but they have finally made it into Salesforce1, users can now submit their records for approval from within the app. A slightly glaring hole plugged beautifully (and quickly).

My developer highlight for Summer'14 Salesforce1 (and I feel I have saved the best for last) is called the Account and Community Switcher - which is a complicated way of saying you can switch between orgs within Salesforce1 without having to log the whole app out. This is especially apt for me, as you can see from this tweet.. "Hmm. I wanna test this new app on @salesforce1... But I simply can't log out of my work org on my phone?? "Logout > Yes" just does nothing?!" I have something of a problem switching orgs on my phone (short of uninstalling the app and reinstalling it).

To swap orgs, you simply open the left hand nav, and at the top there is a picklist which will list all of the other orgs connected to the user currently logged in to the app on the device, and you can just tap another account to jump across. Sandbox heaven!! Thank you Salesforce.


(Of course - 6 months ago I would have been over the moon that Salesforce1 is now properly supported on Blackberry (and Windows) phones, but pfft who still has a Blackberry?!)


Final thought for the day, I wonder what the Southern Hemisphere think of the Salesforce release cycle names then, "Summer?" - "Not here mate!" pretty sure we already have all the Winter'14 features down in Oz..

Wednesday, 23 April 2014

Modifying the "New Email on Case" Template in Salesforce

If you are using Email-to-Case on Salesforce, there is a super handy standard feature that will send an e-mail out to the case owner when a new incoming e-mail is filed against one of their cases.

This is an option turned on via Setup > Customize > Cases > Email-to-Case and then checking the box "Notify Case Owners on New Emails.


Then, when an incoming e-mail is detected by your Email-to-Case config and associated with a Case, the owning user will get an e-mail that reads:

An email has been received for case 00003630: Case system test.

Please click the link below to review the new email and respond appropriately.

[https://na13.salesforce.com/02sf00000000000]

NOTE: It is not recommended that you forward this email because its association with the original case may be lost.

and then the body of the email from the customer..

The requirement that led me to end up writing this was to replace the link in the middle of the e-mail for a client, but I can imagine a whole host of reasons this message might want customising in client systems.. but, if you are setting out on that road, like me, you will probably find quite quickly it is not a standard or custom e-mail template that you can edit. It is fixed, and can only be turned on; and off.

So what do you have to do if you want to edit it? You have to turn it off and replicate the functionality.

Turning it off can be done by following the navigation steps above and then de-selecting the checkbox. Now, when a new e-mail enters a case via Email-to-Case, there will be no notification. Now, you need to build a workflow rule to replicate the functionality.

That is not as simple as it sounds though. Here are the steps we will have to go through:

  • Create a workflow rule on Email Message that will be triggered when a new incoming case e-mail is inserted
  • Because Email Message workflows cannot dispatch Email Messages themselves, we will have to do a field update instead, which we perform on the parent Case
  • Add a workflow rule to the Case object to send the owner an e-mail when it is updated by the previous workflow
First we need the field on Case to update; lets make this field a Date field, as it is something we can set with a formula value quite easily and it gives us an audit value that maybe just one day might be useful to someone!

Access your case fields via Setup > Customize > Cases & Fields and click to create a new field. Call the field "Last Emailed" so the API name is Last_Emailed__c and set it's type to "Date/Time"- make it not required and with no default. I would leave field permissions at the defaults, but then remove it from all page layouts (for the moment at least).

Now we have our field, we need to cause it's update, and then effect it's action to dispatch an e-mail. First let's set it, and we are going to do this when a new Email Message is received on a case.

Click through Setup > Create > Workflow & Approvals > Workflow Rules and click to create a new rule.

On the first page, select "Email Message" from the object drop down (this may only be there if Email-to-Case is enabled). Call it something like "Custom Notification Email" and have it fire whenever a record is created. Set your Rule Criteria to be a Formula, and for the formula enter "true" so every message triggers this Workflow.

On the next page of the Workflow, click to add a New Workflow Action and then select New Field Update and populate it as such so that it will update the case field we have just created to the value of the Formula method "NOW()":


Once this is done, and you are presented with the Workflow, here is a catchy step. Click to Edit the field update you have just created, select the check box to "Re-evaluate Workflow Rules afer Field Change" and save it.

Edit: July 2015

Thank you readers for your comments that this stage is no longer possible! I recreated the steps and lo-and-behold, you cannot mark this field update to re-evaluate. How weird.
 
Therefore, we need to find an alternative way to send the e-mail based on this first workflow evaluating. Well seeing as it's now 2015, why not use Process Builder! Process Builder comes later in the order of execution than Workflow, so I can't see why you couldn't create a process based on the same conditions/premise as this post - that sent an e-mail when the Case "Last_Emailed__c" field was updated.

I don't have time right now to test this sorry :( but if anyone has any luck with that route, please let me know in the comments. Just replace the word "Workflow" with "Process builder" for the rest of this article, and the complicated screen shots for the lovely new screenshots that a Process might have!

Resume original post:

Finally, complete the Workflow setup and remember to activate it! This is the most commonly made workflow mistake is forgetting to activate! We now have the second stage of our process complete.

Before we can make our final Workflow rule to dispatch a custom e-mail, we better make sure we have our custom e-mail template ready to use. Click through Setup > Communication Templates > Email Templates and make a new template (the details of the process for which I will not cover here as it is well documented).

Now we can make that final Workflow rule. Go back to Setup > Create > Workflow & Approvals > Workflow Rules and click to create another new rule. This time, we are making it on "Case".

Give you rule a name, and select "created, and every time it's edited" as your evaluation criteria. This time, the rule criteria is important, as we don't want to send an e-mail everytime any change is made to a case, therefore, select the formula criteria entry again, and this time enter

ISCHANGED(Last_Emailed__c)


This means the Workflow will only fire if the "Last_Emailed__c" field has changed from it's previous value (i.e. the first workflow rule caused it).

Once we have this, get into your new Workflow rule, add an Email alert, choose your custom template (this is the point you might want to set off your success fireworks) and pick the "Owner" as the recipient. Fiddle with any other settings you like, then save your Workflow, activate it, and sit back and watch as new incoming e-mails cause the dispatch of a custom notification email to the case owner to inform them of this message.



Monday, 24 March 2014

Packt Publishing - BOGOF on 2000 IT books!


 Recently you may have seen recently I was reviewing the Visualforce Developers Guide by W.A. Chamil Madusanka (full blog post is still in draft!), published by PACKT Publishing, who in their own words are "one of the most prolific and fast-growing tech book publishers in the world".

Along with the Developers Guide, my colleague Christopher Alun Lewis has reviewed Kier Bowdens Visualforce Development Cookbook - which I am also now reading and is another fantastic publication keeping us all up to date with the best Salesforce design patterns and practises.

Having been through these two great publications, I am now always on the look out for the next PACKT title, and it has come to my attention, that for TWO MORE DAYS ONLY!! (that is until March 26th 2014) in celebration of reaching 2000 published titles PACKT are offering a "Buy one Get one Free" across their entire range of eBooks. That means there a literally hundreds of fantastic software titles just waiting to get swept up on every aspect of Software Engineering. You could honestly get the two books mentioned above for the price of one (but I'd recommend browsing their full range before decided what to get!).

If you follow this link through to PACKT publishing, you can buy as many eBooks as you like, and when you get to the checkout, you will immediately notice you are only paying for half of them!


Don't waste any time on this one, as there isn't much time left. Have a word with your line manager about getting some technical reference material in and go crazy. You're never too old to learn how to do your job better, and to know a little more!

I would like to make it clear that by participating in this BOGOF campaign promotion, PACKT Publishing are furnishing me with a free book from their library.

Tuesday, 11 February 2014

Getting stacked with Salesforce!

For the last two years (thanks to a successful Area51 Beta) Salesforce has had it's own branch of the Stack Overflow product, in which users can ask, answer, discuss and vote on Salesforce issues, problems and features they are working on. This is the Salesforce (beta) StackExchange.

Over the last two years, this product has exploded in the Salesforce developer domain, with (at the time of writing, in February 2014) statistics in the region of:


8,729questions
12,841answers
90%answered
4,330users
11,338visitors/day





With useage, and success rates like that, it's easy to see why the StackExchange is becoming the go to place for Salesforce questions, with answers typically being provided in a matter of minutes, to some of the most complicated questions.

With thousands of users, from every timezone in the world logging in every minute of the day, it is clear to see why and how if you have a query about Salesforce, there is going to be someone out there who has experienced this before, or has the knowledge to guide you through to a solution.

But is that the real reason the StackExchange is so popular? Of course not, it's all about badges and reputation of course!! One of the most addictive types of gamification in the modern arena is earning reputation from your peers for assisting them, and by providing the best service over your peers!


The model has completely hooked me. I even find myself logging on from my smartphone during bus rides to see if there is a question I can help out with! The buzz of finding someone you can assist is matched only by the excitement in your hands as you rattle out an answer at a typing speed that would make the Clerk of the Houses of Parliament blush.

The other great aspect of the reputation model, is the philanthropy,  as well as enjoying earning it by assisting your community, you have the power to award it as well, if you see an answer that you wholeheartidly agree with, you can vote it up, making it clear to the community that this is a quality answer, and also awarding the user reputation in the process.

Good questions, equally, can be voted up if you think them especially pertinent, and even the smallest aspect - comments - can be flagged as useful or helpful making sure everyone knows which snippets of text are good or bad.

Some of the questions that I have asked and answered include:

Getting the value of an inputField on the page

Which has been viewed over 3,500 times.


Friday, 10 January 2014

Getting your Certified Force.com Certification

On January 8th I had the pleasure of presenting a case at the South West UK Salesforce Developer meetup, which is an event that happens every other month in Bristol UK, where the regions Salesforce developers, CTOs, and Force.com-curious meet up for a couple of pints, some short talks, and a lot of technical debate about living on the Force.com Platform.

The theme of our January meetup was "Certification" - which we thought was appropriate, what with this being the time for resolutions and making plans. I co-presented the first talk which was an introduction to certification process through the Certified Force.com Developer option. The second presentation was by Christopher Alun Lewis on his experience of the Advanced Force.com Developer.

Here are my slides from the talk, which I was asked to share by some of the audience, and below them a quick script covering what I spoke about on each, to support the otherwise vague bullet points!


Slide 1: On this deck, this is an into slide.

Slide 2: Welcome to the South West DUG presentation on becoming a Certified Force.com Developer, I myself have been certified for about 18 months now, and Julio, who will be telling us all about his experience with certification, has been qualified himself for 6 months.

Slide 3: What is the Certified Force.com Developer qualification then? It's a badge, that you can quite literally wear (see slide 4) to indicate that you are a competent Force.com developer, familiar with the platform and it's features and functions. If you want to pitch yourself to clients and employers as a Salesforce developer, it really should be seen as the minimum entry criteria. It is an exam based qualification, which is taken in an invigilated enviroment, and consists of 60 multiple choice questions about developing on the Force.com Platform, of which you must get 41 right. You have 90 minutes to do so, and once you have submitted your answers, the examination software instantly tells you if you have Passed or Failed.

Slide 4: An example of putting the badge into place!

Slide 5: So how do you go about getting certified down in the South west of England? Our test centre is in Bath, by the river, about 10-15 minute walk from the train station, so it's really not hard to get to.  A bigger consideration is perhaps that it does cost $200 USD to take the exam and you do need to book in advance (normally a week or two at least) on the certification website. Once you have the qualification, you should also note that it has to be kept up to date, and this is done via 3 annual maintenance exams. These are done on your home PC in your own time (within a 5-6 month window) and involve answering 6 more multiple choice questions on the latest features, or platform core concepts, to show you are still a valid, involved developer. The first year comes free with your qualification, but after that you must pay $100pa to keep the certification valid.

Slide 6: What is it they are looking for then when you walk through that examination door? The Certified Force.com Developer is not about code, or syntax, or APIs or Libraries. It's about understanding the Force.com platform, and knowing WHEN to code and WHEN to click. You need to show a good understanding of configuration driven solutions, or when you would be forced to code. You do not need to know the code you would use though. The second part of this slide is taken from certification.salesforce.com verbatim, and breaks down the core concepts the exam will cover. Be familiar with ALL of these areas, you cannot pass by being a total expert in some, and know nothing of others.

Slide 7: The tools of the trade then, how do you go about actually passing the exam? Your first choice would of course be the course. Salesforce 401 covers the exact requirements for the Certified Force.com Developer qualification. But in the UK you would probably be looking at taking part in a 5 day, virtual classroom experience for the best part of £3,000... if you got the time and the money, I guess go for it, but failing that, the fundamentals book, and a bit of hands on experience with the Platform will serve you just as well. All the Certified Force.com Developers I know have self-taught/learnt on the job. I do know some of the qualified trainers on the 401 track through, and they are bloody nice people :)

Slide 8: This is Julio's story, .. another great read on the Certified Force.com Developer road.

Slide 9: So this is my story, now you know the facts of life. I had been working on the platform for about a year when the time came for me to get the certification. I came from being a Java developer, with 6 years commercial experience and a Computer Science degree, so I felt ready for a new examination challenge. I would say one of the biggest benefits for me was working alongside an existing Certified Force.com Developer, so any time I had a question both about the platform or the certification process, I could ask him, and he could put my mind at ease about the logistics and process of the exam. I booked my exam in with about 2 months notice, to let me gear up for it, and the last thing I did, was take 2 weeks out (of life) and just ploughed through the entire fundamentals book, doing the exercises and extensions, to remind myself of the core concepts, and all the bits (like reports and, security) that we don't really think about properly during our day to day work. On the day, I took about 75 of the 90 minutes to answer, review and submit my winning score to the system, I chose not to beat myself up for the full time period, because I would only end up over thinking choices and changing right answers.

Slide 10: So, any questions? If not... here's one for you..

Slide 11: This is the actual example question off the certification.salesforce.com website for Certified Force.com Developers. Can you answer it? I'm not going to tell you the right answer, but chuck me a comment in the section below with your thoughts!

Well. Thanks for reading through that journey with me! If you'd like to know more, please get in touch and I will field your questions, you can also tweet me on @srlawr if you like. If you live in the south west UK, get in touch with your local Salesforce Developer User Group for free beer and chats like these.

Thursday, 28 November 2013

Know your apps from your apps

Having just been at Dreamforce 2013 with Desynit, we have all come away with bright, wide eyes, staggering forward repeating the word "app, app, app" like a mob of geeky zombies. Filling the "app gap" has been cited as our number one priority, and the new Salesforce 1 Platform has basically been given to us as an incredible "free tonne of bricks" to start doing this.

But it appeared during discussions that this concept is starting to confuse a few people, and after a few whiteboard sessions explaining similar concepts over and over, I decided a blog post was in order on "what is the difference between an app, an app, and an app?"

It's a good question actually, and typically we use a couple of pre-cursors to help us separate the types of app, and it's important you know the difference before you go applying the term to your business.


The traditional, and predominant use of the term "app" is referring to what we technically call a "native app" and these are specifically (and expensively) written pieces of software designed to run on a certain type of device. Everything you download from the AppStore™ for your iPhone™ is ultimately a native app for your Apple™ devices.

These native apps are written in the appropriate programming language for the device they are intended to run on (ObjectiveC for Apple™ devices, Java for Android etc.etc.) and are typically fairly difficult to port between the different devices. They communicate with your Salesforce org via the various APIs sending data back and forth over secure external connections.

They are also written, compiled and released at a set moment in time, and do not change from that point (other than by lengthy update processes). This means if your underlying Salesforce data structure or business processes change, your expensive app might become redundant.

One worldwide example of a native app could be seen in downloading the facebook app available to almost every mobile device in existence.

The second most common use of the term is referring to "web apps" these are slightly newer to the scene in their most popular format as it has taken longer for mobile and tablet devices to consistently come up to speed supporting the predominant technologies, HTML5 and CSS3.

The key to web apps is that they are not "downloaded" and stored on the mobile device, but are instead "accessed" - typically though the phones standard web browser - and are so cleverly written they provide a rich and functional experience. The actual compilation and markup is generated by the webservers, off on the internet, and the interfaces then rendered out by the phone. A lot of interesting libraries and technologies exist (such as Dojox.mobile and PhoneGap) that can detect the "type" of device being used and then make the web page mimic the native control's appearances giving the user a very consistent experience, but in fact actually running almost no logical code on the device at all.

Some of the huge perks of these apps is that they quite simply run on any device that can access the internet. They can be seemlessly updated on the servers, and the user receives the updated version immediately, and because they are probably typically provided by, or hosted on the users core system, have unrivalled access to the company data.

An example of a web app can loosely be seen by accessing the facebook website on a mobile device (typically accessible on http://m.facebook.com) - you will receive a rich and integrated Facebook experience, but without a native app, purely through the browser.



The final kind of app a user might experience is called a "hybrid app" and you might not be surprised to hear that this is a mixture of the two app types mentioned above. Hybrid apps - such as the latest and greatest Salesforce 1 Platform typically have a native container, that the user downloads to their mobile device, but this then delivers rich web content through windows, or frames to the companies web service.

Hybrid apps, whilst therefore still limited to distribution through appstores on the relevant hardware (basically; sorry Blackberry users) can harness the full power of the devices features and hardware, whilst delivering an up-to-date web services.

In summary the original interpretation of the term "app" being a native piece of software for a phone, is - in this developers opinion - possibly now one of the more restrictive and life-limited meanings. The huge cost and limited flexibility means that unless you directly intend to take advantage of the increased local processing power/storage and access to the device hardware it really isn't the most sensible option any more. I am convinced that more and more apps will at the very least be naturally evolving into Hybrids, the incredible power demonstrated by Salesforce 1 shows how you can be seamlessly passed between native and web services without any interruption or hassle for the end user.