Meteor Resources to Get You Started

As with any new development platform or framework, it takes time to master. Getting the right information to start you off is the key to enjoying the ride and building successful web apps.

I have collected a number of references to sites and videos that I refer to and used to learn the way.

In the Beginning

If you know nothing about Meteor then to get you started I would recommend Discover Meteor eBook, which takes you through the main features of Meteor while you build an app. You can get the first part of the book for free if you sign up with your meteor.com account

https://book.discovermeteor.com/

Another great tutorial is provided by tuts+ and aimed at prototyping with Meteor. It’s a great primer for learning though.

http://code.tutsplus.com/tutorials/prototyping-with-meteor–net-30915

BulletProof Meteor is a good turtorial that goes deeper into MongoDB and NodeJS, so recommended after you have completed Discover Meteor.

https://bulletproofmeteor.com/

Learning Resource

There’s a great selection of resources at https://www.yauh.de/best-learning-resources-for-meteorjs/ which has some great links, including resources on Javascript if your not experienced in the language yet.

Best resources to become a master is another great page for Meteor related websites, blogs, books, Youtube videos and communities.

https://gentlenode.com/journal/meteor-4-best-ressources-to-become-a-master/6

Meteor Hacks has a growing resource of tutorials, hacks and projects.

https://meteorhacks.com/

Once you understand Meteor then Meteor Tips and Workarounds is a handy site for you to get some useful info.

https://medium.com/@Dominus/meteor-tips-and-workarounds-b791151ce870

Video Tutorials

Meteor tips has a complete video training course if you prefer this form of training. The course is very reasonable at $39.

http://meteortips.com/screencasts/

You should defiantly subscribe to the Meteor channel on YouTube to get the latest information and see videos from Dev Shops and conferences.

http://www.youtube.com/user/MeteorVideos

Cheat Sheet

Patrick Leet as created a cool cheat sheet on GitHub that I reference and I highly recommend. It’s code with comments but helps you remember functionality. I would recommend understanding the structure of a Meteor app before using this though.

https://gist.github.com/patrickleet/6312627

Meteor Packages

One of Meteor’s strengths is the ability to extend its features with meteor packages. So adding login accounts features or including Bootstrap is a breeze. AtmosphereJS is a fantastic site where you can search for these Meteor packages.

https://atmospherejs.com/

News Sites

The following news sites are a great resource to keep up with what’s happening in the Meteor world, so keep an eye on them.

http://crater.io/

Meteor Project Startup Sheet

Recently I have been developing web projects in Meteor and really enjoying the platform. Whenever I develop in a new platform or framework I create a kind of crib sheet of commands I use to start a project up.

Here’s the list I use for Meteor:

  • meteor create <project name>
  • add folders to project – client [helpers, stylesheets, templates], lib [collections], public & server
  • meteor add jquery
  • meteor add bootstrap
  • meteor add iron:router
  • meteor add accounts-base
  • meteor add accounts-password
  • meteor remove autopublish
  • create server/publications.js
  • create client/template/application/layout.html
  • create lib/router.js
  • create server/fixtures.js
  • create client/main.js

In addition I have been experimenting with polymer, which you can add to your project with meteor add ecwyne:polymer-elements

Salesforce – Re-assigning Event Re-occurrence Instance

Utilising the Salesforce Calendar for events has many benefits compared to using Outlook.

One of my clients came across a limitation recently when they create a weekly re-occurring event for their team member. The problem is that when the staff member cannot attend the appointment they then need to re-assign it to someone else.

With the current version of Salesforce you cannot do this, you can only reassign the complete series to someone else.

The good thing is that with a bit of research I found that each occurrence is a record. So my first attempt was to find the event and then using a Visual Force page I asked who they want to reassign it to.

I wrote some Apex code to update the record to the newly assigned user, but the Salesforce business rules do not allow this.

So the solution was to clone the event into a new object, delete the original and insert the new. This worked beautifully.

public class ReassignEventController
{

    public String assignTo { get; set; }

    public List getUsers() {
        List options = new List();

        for(User u :[SELECT Id, Name FROM User]) {
            options.add(new SelectOption(u.id, u.Name));
        }
        return options;
    }

    public Event getEvent() {
        return [SELECT Id, Description, Owner.Id, Owner.Name FROM Event
                WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public PageReference reassign() {
        System.debug('Save clicked: ' + assignTo);

        Event ev = [SELECT Id, WhoId, WhatId, Subject, 
                    Location, IsAllDayEvent, ActivityDateTime, 
                    ActivityDate, DurationInMinutes, StartDateTime, 
                    EndDateTime, Description, AccountId, OwnerId, Type, 
                    IsReminderSet FROM Event
                WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
        ev.OwnerId = assignTo;

		Event ev2 = ev.clone(false,true);
        ev2.OwnerId = assignTo;

        Insert ev2;

        Delete ev;

        PageReference redirecturl = new PageReference('/' + ev2.Id);

        return redirecturl;
    }
}

Once the event has been created then it redirects to the newly created one details page.

The Visual Force page is very simple and I will probably include this in the Event details page.

<apex:page controller="ReassignEventController" >
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="Re-assign Event to User" >
                <apex:outputField value="{!event.Owner.Name}" />
                <apex:selectList label="Assign to" id="assignTo" value="{!assignTo}">
                    <apex:selectOptions value="{!users}" />
                </apex:selectList>
                <apex:commandButton action="{!reassign}" value="Re-assign" />
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

I hope this helps you if you come across the same situation too. Leave a comment if you need help.

The Road to Become a Salesforce Developer

If you are considering becoming a Salesforce / Force.com developer and confused how to get started then have a look at my chart that shows the skills you need to learn and the approach I am taking.

I will post enhancements to this from feedback and my own experiences.

The Road to Become a Salesforce Developer

Road to Dreamforce ’13 Episode 1: What’s New at Dreamforce?

Integrating Google Maps V3 into a VisualForce Page

I recently had a requirement to implement a Google Maps view for an Account and thought I would share the code I wrote to implement this functionality.

Firstly I needed to create a Visual Force Page containing the same structure as the default page, which is easy with just one line of code:

<span class="kwrd">&lt;</span><span class="html">apex:detail</span> <span class="kwrd">/&gt;</span>

The rest of the implementation requires a bit of Javascript to convert the UK Postal code into coordinates and then generate the map.

To convert a Postal code into coordinates you need to use the geocoder object:

<span class="kwrd"> var</span> geocoder = <span class="kwrd">new</span> google.maps.Geocoder();
 geocoder.geocode({
   address: <span class="str">&quot;{!Account.BillingPostalCode}&quot;</span>
   }, <span class="kwrd">function</span>(locResult) {
     <span class="kwrd">var</span> lat1 = locResult[0].geometry.location.lat();
     <span class="kwrd">var</span> lng1 = locResult[0].geometry.location.lng();
     <span class="kwrd">var</span> myLatlng = <span class="kwrd">new</span> google.maps.LatLng(lat1, lng1);
     <span class="kwrd">var</span> myOptions = {
       zoom: 14,
       center: myLatlng,
       mapTypeId: google.maps.MapTypeId.ROADMAP
     }
     <span class="kwrd">var</span> mapComp = document.getElementById(<span class="str">&quot;map_canvas&quot;</span>);
     mapComp.style.width = <span class="str">'900px'</span>;
     mapComp.style.height = <span class="str">'500px'</span>;
     <span class="kwrd">var</span> map = <span class="kwrd">new</span> google.maps.Map(mapComp, myOptions); 
     <span class="kwrd">var</span> marker = <span class="kwrd">new</span> google.maps.Marker(<br />             {position: myLatlng, map: map, title: address});  
                 
 });

The code above also generates a map object which can be rendered on the page.

The complete code sample can be downloaded here (don’t forget to put your own API key into the code.

image

Button Click Admin Podcast

If you are into Salesforce and Force.com like I am then I highly recommend you listen to the the Button Click Admin Podcast. Mike and Jared to an amazing job talking to people in the Salesforce community

logo

I especially love hearing at the end of each podcast when they ask the interviewee what their favourite Dreamforce moment was.

Hop along to http://buttonclickadmin.com to subscribe to their podcast. I also recommend reading the 5 tips to landing a Salesforce.com Admin job

Salesforce Chatter Triggers

Today I wanted to create an app that would allow me to add my activity so that I can analyse my time at a future date. I started my trusty IDE to start mocking up the idea when I had to step back for a moment and think there must be a simpler way to do this.

I use Salesforce for managing my projects and I usually post chatter messages to myself and others. What if I could post a custom # message that would be intercepted and posted to a custom object.

No problem… I created a custom object called Activity:

image

Then all you need to do is go to Customize > Chatter > Triggers and add a new trigger on the Feed Item.It’s then a matter of looking for a #activity tag in the feed item body, pulling the entry out and inserting it into my Activity custom object.

<span class="lnum">   1:  </span>trigger ActivityPost on FeedItem (after insert) {
<span class="lnum">   2:  </span>    <span class="kwrd">for</span> (FeedItem f : trigger.<span class="kwrd">new</span>)
<span class="lnum">   3:  </span>    {
<span class="lnum">   4:  </span>        <span class="kwrd">if</span> (f.Body.startsWith(<span class="str">'#activity'</span>)) {
<span class="lnum">   5:  </span>            funcoder__Activity__c a = <span class="kwrd">new</span> <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; funcoder__Activity__c (
<span class="lnum">   6:  </span>                Name = f.Body.replace(<span class="str">'#activity'</span>,<span class="str">''</span>)
<span class="lnum">   7:  </span>            );
<span class="lnum">   8:  </span>                    
<span class="lnum">   9:  </span>            insert a;
<span class="lnum">  10:  </span>        }
<span class="lnum">  11:  </span>    }
<span class="lnum">  12:  </span>}

Now just go and enter a chatter message, for example #activity Developed an activity application in Salesforce.

Released Expensy, my first Windows Phone App

todayI originally wrote Expensy for myself as I just wanted to keep track of my total outstanding Cash. I didn’t want to know about what money was in which account. Just a simple view of a total amount and a quick way to add spending and adjust the balance.

That’s how Expensy was conceived and I was really interested to try my hands at developing for the Windows Phone platform as I love the interface. Its so much cleaner and different to the typical icon based OS’s.

It’s now available free on the app store and hope you enjoy using it.

http://www.windowsphone.com/en-gb/store/app/expensy/d22afcc1-24df-42f2-a283-1b22e6095435

Top Apps RIM Need to Release with BB10

bb10 The week has finally arrived where RIM will showcase there new BB10 OS and devices on 30th January. I truly believe that RIM have got this one totally right, from the cool and smooth OS to the way they treat developers like myself.

I have been thinking about the types of apps I use on my other devices which I would need to make BB10 work for me on all levels. Here’s the list and why not leave a comment and on what apps you want on the platform:

  • Google+
  • Facebook
  • Twitter
  • Google Reader App with offline sync
  • Natwest App
  • Linkedin
  • Engadget
  • The Verge
  • Spotify
  • Podcast Player / Manager
  • Toshl
  • Skype
  • Lumosity
  • Pocket
  • Dropbox
  • Kindle
  • Runtastic
  • Candy Crush (Yes I am addicted)