Memorable Cigarettes

After nearly fifty years, I can still remember the first time I smoked a cigarette. It was early spring and my family lived on a farm in a semi-rural part of Colorado, a little north of Denver, at the foot of the Rocky Mountains.

I lived there with my mother, wicked step-father (I’m not even sure they were married, to be honest) and little half-sister. The closest kid my age lived more than five miles away, so I had no one to play with. This meant I had to find ways to keep myself entertained. Most of them ended up being things little boys are not supposed to do. Left to my own devices, it’s a wonder I lived through all of my escapades.

I was seven years old and had stolen a pack of my mom’s Kool Menthol 100s. I had a pack of matches from somewhere (yes, I was a pyro too, but that’s a post for another time) and thought I could smoke just like mom and wicked step-father did. After taking a pack from her carton in the refrigerator, I snuck outside and hid behind the juniper trees where I wouldn’t be seen. I opened the pack, took the long cigarette out, put it between my lips, struck a match, lit up and took a big puff like I’d seen the adults do.

Oddly enough, I wasn’t repulsed by the taste. In fact, I actually liked it. I still remember the menthol sensation on my tongue. It had a little bit of burn to it, but the taste wasn’t that bad. I felt very grown up.

Of course, my little boy brain didn’t know you should inhale the smoke from a cigarette, which is probably good because I’m sure if I had, I would have wound up puking my guts out behind the trees. Sometimes I wonder; if I had inhaled, would I have ended up picking up the habit nine years later, or would I have been turned off completely?

There were other experiments with smoking through my childhood, but none really stuck. I’d smoke here and there and eventually lose interest.

Until the day I met Tracy. He had just moved into the neighborhood where my mother, step-sister and I were living (wicked step-father was long-gone now). I think he said he was from New York. He was my age but had already become a pack-a-day smoker. I vividly recall the summer evening he offered me a Marlboro Red from his hard pack box. You weren’t cool if you smoked soft pack, you know. It had to be hard pack and it had to be Marlboro Reds.

I began taking him up on his offers of free cigarettes. Before I knew it, I was smoking every day, bumming cigarettes from friends whenever I could. Then the moment I knew I was hooked came: I wanted to smoke while I was alone.

My mother, being the spectacular parent she was, started buying my smokes for me, so I had a steady supply of my own stashed in the refrigerator. Her rationale was that she’d rather I smoke openly instead of hiding it. I think she hoped I’d come to hate the habit and give up. Well, thanks mom, that didn’t quite work out as planned.

So at the tender age of sixteen, I became a confirmed pack-a-day smoker. All the other kids my age were doing it, so why not me too? The problem was, I really liked smoking. I knew I wasn’t going to stop. Other kids did it to be cool. I did it to feed the nicotine addiction.

Twelve years went by, and then I met Pam.

I still see the moment from our very first date in my mind’s eye. We were running across a busy street in downtown Santa Monica to get to the club where we were headed to see a band. In the middle of the street, the hard pack of Marlboro Lights fell to the ground from my shirt pocket with a loud plop sound. I bent down and picked them up. When we got to the sidewalk on the other side, she immediately told me “I don’t date people who smoke.

That was a punch to the face, but one I’m glad I took. Naturally, I didn’t light up on that date, or any other we had after that. We’re still married 25 years later and she’s my best friend. I made the choice to quit because of her and I’m proud to say I haven’t smoked a cigarette since before we were engaged.

I can remember a bunch of different cigarettes I smoked through my life, but thanks to someone who is very special to me, I can’t remember the very last one. For that, I’m forever grateful.

Eliminating Digital Distractions

If you take time to look up from your own phone for a minute, you’ll find a sea of humanity with faces buried in their own devices.

Life is so full of distractions. It seems everything is vying for our attention in one way or another these days, with most of it coming from our electronic gadgets.

If you take time to look up from your phone for a few minutes, you’ll find a sea of humanity with faces buried in their own device. It’s painful to watch.

Personally, I’ve come to a point where I’ve had it with the digital distractions in my life, so this is what I’ve done about it.

I Removed the Useless Apps from My Phone

There was a time I had more than four screens of apps on my iPhone. I know many people who have far more than that. I don’t know how they manage all those screens since I could barely cope with the number I had. I’d regularly forget where an app was, which would usually be somewhere on the third screen, beyond two other screens of mostly unused apps.

Though I wasn’t aware of it, I’d made a game out of shuffling apps around on my home screens, hoping to one day land on the perfect combination that made perfect sense and put the universe back in order. Honestly, I think most of the apps on my phone back then got moved around more often than they were ever used.

Once this dawned on me, I decided it was time to purge. The first order of business was to get rid of the useless time-wasting “social” apps. I removed them from my phone without hesitation, deciding if I want to spend time on Facebook, I’ll make time specifically for it. Now, I’m lucky if I look at the site more than three or four times a month. I don’t miss Facebook and could probably go without it entirely if I decided to. I only keep it around to stay in touch with extended family and old friends. I intentionally pared my “friend” list down to less than 50 people that I actually know too.

After nuking the useless apps, I started an experiment with the remaining by moving the ones I didn’t absolutely need to a “folder” on the second home screen. If I used an app more than a few times in a week, it got “unpacked” and promoted back to the first home screen. After a month of this, I ended up with just 16 apps on my first screen – including the four I’d left in the dock as “must-have” when I started.

For apps that I didn’t touch after two months, I completely removed them from the phone. I know if I ever need a particular app, I can download it again — where it will find its rightful place on the second screen with all of the other lesser-used apps.

I evaluate my home screen every few weeks now to demote or remove apps if I feel they’re not serving a purpose. This has helped me stay laser-focused when I’m using my phone.

I Set All But the Most Important Apps to a Badge Notification

For the apps I keep on my phone, if I need to see a notification of some kind, I’ll set it to badge only. No sounds, vibrations, banners or alerts to distract me. I’ll check it on my schedule, thank you very much.

This includes email — both personal and work. I purposely decided I didn’t want up to the moment email notifications, and I’ve found it quite liberating. Now, when I see a badge on an app, maybe I’ll look at it, maybe I won’t. It pretty much depends on the number displayed on the badge whether I decide to act.

Of course, there are exceptions to this rule, but they are few. The Phone app obviously needs notifications — otherwise, my phone isn’t a phone. Same for goes for Messages. I communicate with my immediate family by text a lot, so I leave this notification enabled.

The only other notifications I allow are OmniFocus for task management and Fantastical for calendars. I definitely need to be on time for meetings and appointments, and I must complete my tasks on time too.

Finally, I turned on “Do Not Disturb” mode between the hours of 10pm and 6am — which is when I go to bed, and an hour after I get up. That first hour in the morning with no distractions helps me get focused on my day ahead.

If you’re a notification junkie like I was, it’s hard to get used to working this way. But if you give it some time, you’ll find you’re picking your phone up a lot less and getting a lot more done during the day.

Give it a try. You’ll feel less tethered to your phone, I promise.

I Set Limits on Use

As a family, we’ve agreed to set limits on when and where electronic devices are acceptable. Never, ever can any one of us bring a phone to the table during a meal. This rule extends to restaurant outings too. Once a meal is on the table, all gadgets go away until after the last person finishes their meal.

If we’re in a family setting for the holidays or a birthday, all devices get put away in pockets and purses so we can spend time socializing face-to-face. It’s okay if a phone comes out for a photo or two, but if any family member gets caught zoning out on their phone, everyone else reminds them of the rule. It’s worked pretty well so far.

These are some of the ways I’ve started breaking the twitch to reach for my phone and check it. Sometimes I forget, but I find every day gets a little easier. If you’re looking to lessen your own digital distractions, give some of these a try yourself. You might find there’s a lot more going on around you than you realized.

Spin Cycle

I’ve been around long enough to know life moves in cycles.

Things that were new and exciting one day eventually become dull and boring the next. The pursuit of shiny objects and interesting paths quickly fall by the wayside before you realize it. We move from one thing to the next and then another in search of a quick thrill, because we’ve become instant gratification junkies.

What if, instead, we intentionally slowed our lives down? What if we deliberately chose to look at the world in wonder like we did when we were young? What if we took time out to play like we did when we were children? What if we stopped to listen to what’s going on inside instead of burying our faces in smart devices that make us dumb?

We spend our adult lives working, chasing dreams, and running after material possessions we think will make us happy. But let me ask you; in all of your pursuits, are you truly content?

Is your soul really at peace?

If there’s any hint of hesitation in your answer, it might be time to step back, take a look at the bigger picture, and find what really fulfills you.

Your time on this pale blue dot is finite. It would be a tragic waste to get to the end and say “I wish I could have…” Maybe today should be the day you stop spinning cycles on unnecessary things that don’t matter.

The choice is yours. It has been all along.

Passing Your Salesforce ADM201 Certification Exam

I passed the Salesforce ADM201 certification exam today. It’s been a five-year road to get here. From the first week I began working with Salesforce, I decided attaining certification was something I wanted to pursue.

Now that I’ve done it, I thought it might be good to share the things that helped me be successful with those looking to do the same.

Continue reading “Passing Your Salesforce ADM201 Certification Exam”

Making a Field Appear Required on a Visualforce Page

I’ve been working on a force.com app with the requirement that a user must enter a valid email address on a Visualforce page before being able to save a record.

But they must also be able to insert the related contact’s email address by clicking a button instead of having to leave the edit page to go find it. That seemed simple enough, but it wasn’t. This is my solution for making a field appear required on a Visualforce page.

Gift card screenshot.

In my original Visualforce page, it seemed logical that if I set the recipient email field as required, all would work as expected. However, defining the field as required prevented my custom action in my page controller from firing and entering the email address.

Original Page Controller

public class GiftCardTestController {
    private ApexPages.StandardController std;
    public String cEmail {get;set;}
    public Gift_Card_Order__c gc {get;set;}
    public GiftCardTestController(ApexPages.StandardController stdCtrl) {
        std = stdCtrl;
    }

    //selects the email address of the related contact
    //and inserts into recipient email field.
    public void fillEmail() {
        gc = (Gift_Card_Order__c)std.getRecord();
        cEmail = [select Id, Email from Contact where Id = :gc.Contact__c].Email;
        gc.Recipient_Email__c = cEmail;
    }
}

Original Visualforce Page

<apex:page standardController="Gift_Card_Order__c" extensions="GiftCardTestController" title="Gift Card Test">
    <apex:form>
        <apex:pageblock title="Gift Card" mode="edit">
            <apex:pageblockbuttons location="top">
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <<apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
                <apex:commandbutton action="{!fillEmail}" value="Fill Email"></apex:commandbutton>
            </apex:pageblockbuttons>
            <apex:pageblocksection title="Email Info" columns="1">
                <apex:inputfield value="{!Gift_Card_Order__c.Contact__c}"></apex:inputfield>
                <apex:inputfield value="{!Gift_Card_Order__c.Recipient_Email__c}" required="true"></apex:inputfield>
            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

In this example, the fillEmail() action should select the related contact email address, and put the value in the Recipient_Email__c field so the user can see it.

But it’s not that simple it seems. When the field had the required=“true” attribute set, the action would not fire because all validation is done on the client side and the page never posts back to the server — so the controller action never gets called.

So after some digging and asking for help on the Salesforce discussion boards, the solution was to make the Recipient_Email__c appear as if it’s required on the page (though it’s really not), and add a new save method to my controller to handle field validation on the server side when the record gets saved.

New Page Controller

public class GiftCardTestController {
    private ApexPages.StandardController std;
    public String cEmail {get;set;}
    public Gift_Card_Order__c gc {get;set;}
    public GiftCardTestController(ApexPages.StandardController stdCtrl) {
        std = stdCtrl;
    }

    public void fillEmail() {
        gc = (Gift_Card_Order__c)std.getRecord();
        cEmail = [select Id, Email from Contact where Id = :gc.Contact__c].Email;
        gc.Recipient_Email__c = cEmail;
    }

    // add custom save method...
    public pageReference save() {
        gc = (Gift_Card_Order__c)std.getRecord();

        // if the recipient email is null, add an error to the field
        // and return null to remain on the current page...
        if(gc.Recipient_Email__c == null) {
            gc.Recipient_Email__c.addError('A valid email address is required.');
            return null;
        }

        // otherwise, the field is filled, so it's okay to redirect to view page.
        // standard field validation will check for valid email format.
        else {
            return std.save();
        }
    }
}

New Visualforce Page

<apex:page standardController="Gift_Card_Order__c" extensions="GiftCardTestController" title="Gift Card Test">
    <apex:form>
        <apex:pageblock title="Gift Card" mode="edit">
            <apex:pageblockbuttons location="top">
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
                <apex:commandbutton action="{!fillEmail}" value="Fill Email"></apex:commandbutton>
            </apex:pageblockbuttons>
            <apex:pageblocksection title="Email Information" columns="1">
                <apex:inputfield value="{!Gift_Card_Order__c.Contact__c}"></apex:inputfield>

                <!-- Updated pageBlockSectionItem -->
                <apex:pageblocksectionitem>
                    <apex:outputlabel>Email Recipient</apex:outputlabel>
                    <apex:outputpanel layout="block" styleClass="requiredInput">
                        <apex:outputpanel layout="block" styleClass="requiredBlock"></apex:outputpanel>
                        <apex:inputfield value="{!Gift_Card_Order__c.Recipient_Email__c}"></apex:inputfield>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <!--// end pageBlockSectionItem -->

            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

Notice the <apex:pageblocksectionitem /> code to replace the original field. This is how we make the field appear with the “required” bar. A nifty trick that took some digging to discover. Hopefully, this post saves someone else the time it took me to figure it out — and me the time when I forget it.

For convenience, here’s a Github Gist with field label & inline help that shows exactly how to make a field appear required on a Visualforce page.