Salesforce Chatter Desktop / Chatter Chat, Error #2032, “Chatter is not enabled for this organization” FIX!

I had a small win this morning at work.  Apparently, as of yesterday, September 10, 2014, Salesforce made a change such that users with profiles that DO NOT have the “API Enabled” flag checked will not be able to connect to certain Connected Apps.  However, the write up on help.salesforce.com doesn’t (at least at the time of this post) explicitly state that Chatter Desktop and Chatter Chat in the browser will be impacted by this change.

So, if all of a sudden today you have users who can’t connect to Chatter Desktop or Chatter Chat in the browser, and they’re getting the “Chatter is not enabled for this organization” error message in Chatter Desktop of the generic message in their browser pop up with a prompt to try connecting again, go into the profile definitions for their profiles and check “API Enabled.”  That should allow them to authenticate for Chatter Desktop / Chatter Chat in the browser successfully.  Do first consider whether or not their are reasons to prevent the profiles from having API access before doing so.

“Introduction to Algorithms” Exercise 1.2-2

I’ve just started reading “Introduction to Algorithms,” Third Edition, by Cormen, Leiserson, Rivest, and Stein as part of my self-designed, self-taught course in making me a better software developer. I’m two sections in to the first chapter, and what I’m realizing I’m going to need to study up on some fairly elementary algebra. But, I stumbled my way through a problem with base 2 logarithms in play. Here’s my victory for today.

The question was this:

1.2-2  Suppose we are computing implementations of insertion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n2 steps, while merge sort runs in 64n lg n steps. For which values of n does insertion sort beat merge sort?

So, I set up the equation:

8n2 < 64n lg n

Divide by 8, and we get:

n2 < 8n lg n
Or: (n)(n) < 8n lg n

So, divide both sides by n and get:

n < 8 lg n

If we then divide both sides by 8, we end up with:

n/8 = lg n

Now, multiply both sides by 1/n, and we get:

1/8 = lg n / n

Beyond that point, I just pulled out my calculator and started inserting numbers for n and figuring out whether or not the statement was true, as follows:

n = 10:      .1250 < .3322 = TRUE
n = 1:         .1250 < 0 = FALSE
n = 2:         .1250 < 5 = TRUE
n = 20:      .1250 < .2161 = TRUE
n = 30:      .1250 < .1636 = TRUE
n = 40:      .1250 < .1774 = TRUE
n = 50:      .1250 < .1129 = FALSE
n = 45:      .1250 < .1220 = FALSE
n = 44:      .1250 < .1241 = FALSE
n = 43:      .1250 < .1262 = TRUE

So, for integer values (since we can only sort whole numbers of items):

2 <= n <= 43

Now, I’ve only got a natural logarithms button on my Texas Instruments BAII Plus calculator (at least, I’m only AWARE of natural logarithms button on that calculator), so I had to search the web to figure out that to get Log2(x) I could divide Ln(x) by Ln(2) (thanks to TVMCalcs.com for that assist!).

If anyone could remind me of a better way to figure out the range of acceptable answers here than the “guess and check” with the calculator, please leave a comment.  Such would be greatly appreciated!  But, I’m glad I was at least able to come up with an answer this way, and wanted to post about it.

Checking on the Children: Which loop to execute?

I’ve been reading Advanced Apex Programming for Salesforce.com(R) and Force.com(R) by Dan Appleman.  If you’re an Apex programmer, or are aspiring to be one, I highly recommend buying a copy.  I’ve already learned a lot from it, and I’m only in Chapter 4 of 11.

On pages 80 – 82, Appleman introduces a concept that I decided to look at with some code of my own.  He says, “One question that you’ll often face is choosing which object to loop through.”  In this case, Appleman was talking about a method to find Opportunity records without child Task records.  I decided to use custom objects and write a method to check for child objects to make sure I understood his concept.  I went with a concept familiar to me from work on systems I deal with daily: Invoices and Invoice Line Items.

PLEASE NOTE:   The following code is based on Appleman’s samples in Chapter 4 of Advanced Apex Programming…, though mine is far less elegant, and uses custom objects instead of CRM standard objects.


public with sharing class InvoiceIdeas {

 public static Set<Invoice__c> findInvoicesWithNoLineItems(List<Invoice__c> invoicesToCheck) {
 
 Map<Id, Invoice__c> invoiceMap = new Map<Id, Invoice__c>(invoicesToCheck);
 
 Set<Id> invoiceIds = new Set<Id>();
 for(Invoice__c i : invoicesToCheck) {
 System.debug('AN INVOICE ID ADDED...');
 invoiceIds.add(i.Id);
 }
 
 // In terms of worst-case analyis for bulkification, let's say an invoice might have as 
 // many as 30 line items, time 200 possible invoices passed in, for 6000 total records.
 List<Invoice_Line_Item__c> allInvoiceLineItems = [ SELECT Name, Invoice__c FROM Invoice_Line_Item__c
 WHERE Invoice__c = :invoiceIds ];
 
 Set<Invoice__c> invoicesWithoutLineItems = new Set<Invoice__c>();
 for(Invoice__c i : invoicesToCheck) {
 invoicesWithoutLineItems.add(i);
 }
 
 Integer loopIterations = 0;
 
 // Option 1: Loop through all the Invoice records, and see if they have any line items.
 /*
 for(Invoice__c inv : invoicesToCheck) {
 for(Invoice_Line_Item__c lineItem : allInvoiceLineItems) {
 if(inv.Id == lineItem.Invoice__c) invoicesWithoutLineItems.remove(inv);
 loopIterations++;
 }
 }
 */
 
 // Option 2: Loop through the Invoice_Line_Item__c list, and remove their parent Invoice__c
 // record's ID from the set invoicesWithoutLineItems.
 
 for(Invoice_Line_Item__c lineItem : allInvoiceLineItems) {
 Invoice__c inv = invoiceMap.get(lineItem.Invoice__c);
 invoicesWithoutLineItems.remove(inv);
 loopIterations++;
 }
 
 
 System.debug('NUMBER OF LOOP ITERATIONS: ' + loopIterations);
 for(Invoice__c i : invoicesWithoutLineItems) {
 System.debug('Invoice without line item: ' + i.Id);
 }
 
 return invoicesWithoutLineItems;
 
 }

}

I then created 3 invoices in my developer org; one with no line items, and two more with three line items each.

Next, I went into the Execute Anonymous window in the Force.com IDE plugin for Eclipse and ran the following:

List<Invoice__c> myInvList = [ SELECT Id, Name FROM Invoice__c ];

InvoiceIdeas.findInvoicesWithNoLineItems(myInvList);

When I use “Option 1” above, I get 18 iterations of the inner loop. When I use “Option 2” above, I get only 6 iterations of the single loop. So, back in the day when Salesforce was limiting our number of script statements, I can see how our choice of which object to loop through was extremely important. These days, the governor limit we, as developers, have to worry about around this and similar patterns is the CPU time limit. In this case, I put a call to this method (with the Option 1 code running) in a for loop that ran 50 times, and I still didn’t get anything but 0 registering as the CPU time. However, it stands to reason that in a different context with more work being done in the loop(s), this pattern would save us a significant amount of CPU time.

Apex Datetime Method: Using newInstance(Date, Time)

I had a very challenging few minutes this morning around the Apex Datetime Method that takes two parameters; a Date and a Time.  I was trying to fix a Visualforce “report” I had built that takes start and end date parameters from date fields on the Visualforce page.  Well, certain records were being excluded from the reports if they happened on the last day of the date range, so I wanted to get the first second of the first day and the last second of the last day into the incoming parameters for my report date range.

I went to the Salesforce Apex Datetime Methods page, and saw that there was a newInstance method on the Datetime class that does exactly what I wanted; accepts a date and time, and yields a Datetime.  So, I started with something like this:

Datetime reportStartDateTime = datetime.newInstance(reportStartDate, ’00:00:00′);

Datetime reportEndDateTime = datetime.newInstance(reportEndDate, ’23:59:59′);

I tried several different versions of the time value, but nothing was working.  And, worst of all, I was getting a weird error message from Eclipse (Kepler 4.3) and/or the Force.com IDE plugin (I’m in version 31 at this point):

Compilation error: Variable does not exist: datetime

 So, I started doubting if I was using a valid datetime method, and looking for missing semicolons and such.  But, I finally realized that I just wasn’t supplying the time correctly.  Here’s what worked:

Datetime reportStartDateTime = datetime.newInstance(reportStartDate, Time.newInstance(0,0,0,0));

Datetime reportEndDateTime = datetime.newInstance(reportEndDate, Time.newInstance(23,59,59,59));

So, the trick seems to be using the newInstance method of the Time class to get a valid time in there, rather than a string.  I’m guessing there might be a string literal one CAN use to make this work, but I’m leaving that for another day, as it didn’t jump out at me in the documentation, and I’ve got code to commit on deadline…

Salesforce: Automatically Creating an Apex Map from a List with ID of SObject as the Key

I recently learned something that is already saving me a ton of time.  I didn’t know it was possible to take a list of SObjects, and create a Map<Id, SObject> without writing an explicit loop to traverse the list.  But, Apex developers, we can do just that with the following map constructor:

Map<Id, SObject>(List<SObject>)

So, let’s say I’d queried up a list of Account records, as so:

List<Account> myAccountList = [ SELECT Name, AccountNumber FROM Account LIMIT 50 ];

What I had been doing previously to create a Map<Id, SObject> was this:

Map<Id, Account> myAccountMap = new Map<Id, Account>();

for(Account a : myAccountList) {
     myAccountMap.put(a.Id, a);
}

Granted, that works.  But, how much EASIER is this?

Map<Id, Account> myAccountMap = new Map<Id, Account>(MyAccountList);

You can read more about this in the Salesforce documentation on the Apex map class, specifically here.

I also think I read something about the idea in Dan Appleman’s book, “Advanced Apex Programming for Salesforce.com and Force.com..”  If you want to be a better Apex programmer, pick up a copy of that book.  There on links on the book’s website for purchasing a copy.

Salesforce Advanced Developer Quest: Multiple Choice Passed!

Well, I passed the Salesforce Advanced Developer Certification multiple choice exam on my second attempt!  I’m really excited about it.  That actually happened back on May 28, but I haven’t exactly found my stride in blogging regularly.

Some of my colleagues have asked me what made the difference between my first attempt at the exam and my second.  I almost want to apologize to anyone who might read this for what I’m about to say, but I think it’s the truth:  The thing that made the difference was that I started reading the Force.com Apex Code Developer’s Guide straight through.  I didn’t get quite to the end before I took the test again, but I got most of the way through.  I really think that’s what made the difference.  It helped me answer some questions about Apex web services, email templates, etc., that I just hadn’t had an opportunity at work to do much with.  So, for those of you out there in the world working toward that DEV501 certification, my advice is, “Read the Apex Code Developer’s Guide.”

I was also very excited when I got into a programming assignment window faster than expected!  It sounds like I’m going to get my programming assignment on September 29, 2014.  I’ll then have about 3 weeks before I’m schedule for the essay exam.  That was the longest I could give myself with the scheduling options available at the proctoring location I use (University of Louisville, Brandeis Hall, Testing Center).  For some reason, I’ve never really wanted to figure out the requirements for the home proctoring…call me paranoid if you like, but it feels just a little too much like Big Brother would be watching me in my home office (leave me a comment if you think I’m crazy for that, or if you can identify…I’m curious about how other folks feel on the subject).  I also hope that the shorter deadline will keep me from procrastinating until the very last minute, and I’ll have several days after the essay exam / defense of my solution to finish things up before submitting the assignment.

I was lucky enough to get to attend Dreamforce in November of 2013 in San Francisco.   One thing I heard during the sessions about working toward the Salesforce Advanced Developer certification was that you needed to write good test classes, and pay attention to the testing best practices in the Apex documentation.  So, I plan to study up on test class/method best practices between now and when my programming assignment window opens.

I’ll post about my experience with the programming assignment as I go along.  I won’t be able to write anything specific about the assignment due to the non-disclosure requirements of the Salesforce certification program.  But, I’ll write up some general comments about how much time I end up investing, challenges I face, etc.  My hope is that by sharing some of my experience, I’ll be able to encourage some of my colleagues and network to pursue this credential as well.  I’ve really learned a lot already just preparing for the multiple choice, and I think I’m a better Apex / Visualforce  developer as a result.

Wish me luck!

Salesforce Study: “Apex” Online Course, Days 1 & 2

About a week ago, I signed up for the “Apex” online course available via my company’s premier support for our grandfathered Unlimited Edition of Salesforce.  I did the first 3 sections of the course that day, which were largely introductions to the course interface and the Force.com platform.

Tonight, I completed two more sections of the course.  The two sections were, “Introduction to Apex (35 mins),” and “Data Types and Logic (20 mins).” Two things got my attention in that content:

1. Although Apex is very similar to Java in its syntax, one difference is that Apex DOES NOT support “case” and “switch” statements.  This is good to know, as a colleague and I were tossing around the option of changing some code in one of our Salesforce apps to use case…guess we won’t be doing that!

2. I never really paid attention to the different editions of Salesforce, and to whether or not each has the ability to develop Apex code.  It looks like, of the currently existing Editions, Enterprise and Performance Editions will let you create Apex code in SANDBOXES ONLY.  Developer Edition will let you create code in Production, apparently, which I didn’t really think about in the past.  But, yeah, I’m logged in to a dev account writing code for these training exercises, and it’s clearly working.  The Contact Manager, Group, and Professional Editions DO NOT let you create custom apps / develop with Apex code.

So, that’s 5 sections down in the Apex course, and 8 to go.  It looks like I’ve  got 225 minutes of that course left (although the sections take longer than the billed time due to pausing, reviewing, and completing exercises).  I figure 5 to 6 more hours and I’ll have made it through this course.  Yes, a lot of this is review after having been working with Apex and Visualforce for a year and a half, but I’ve already picked up a few things I’ve missed along the way.

Embarkation: My Salesforce Advanced Developer Effort

I’ve barely used this blog for anything.  I really only set it up as an experiment, and thought it might be something I could do to establish an online presence in the interest of advancing my career and/or social life.  Lately, I’ve gotten more into social media, and I can see how it might be fun to get “my blog” involved.  More to the point, I think blogging about my effort to prepare for the Salesforce Advanced Developer (DEV501) Certification might help me stay motivated, via a sense of “accountability” to my readership (which will probably consist of my wife and parents, if that).  Regardless, here goes.

I went to the Dreamforce conference in November ‘13, and had a BLAST.  What an exciting, motivating experience!  At that conference, I took the Salesforce Developer (DEV401) certification exam, and passed!  I had spent maybe 10 hours going through some of the recommended Salesforce training materials from the certification study guide.  Basically, though, that certification covers the declarative tools of the Salesforce Force.com platform, and my on-the-job experience from the past year-and-a-half as a Force.com developer for The MENTOR Network more than prepared me for that exam.

I took the DEV401 exam the first day of Dreamforce, so I made a point of attending some workshops at the conference about my next goal; obtaining the Advanced Developer certification.  I got some great advice.  Then, I came home, got back into the routine of work, and stopped working actively toward the certification for several months.

All of a sudden, it was mid February, and the start date for sign ups for the next Programming Assignment window was a couple of weeks away.  I thought to myself, “Well, I haven’t studied much, but I’ve been working with Apex and Visualforce for more than a year.  I’m going to give the multiple choice exam for DEV501 shot.  If I pass based on what I’ve learned on the job, then I’ll sign up for the programming assignment in this next window.  If I fail, I’ll probably have a better idea of what features I need to study up on for a retake.”

Signed up.  Took the multiple choice exam.  Sadly, failed.  But, it didn’t feel like a colossal failure!  I think I must have been close, because I was familiar with most of the concepts for which the exam had questions.  There were just a few areas in which I clearly hadn’t had enough depth of experience.  So, I left the testing center feeling more motivated than discouraged…I felt like I just needed to really hit the full list of items in the DEV501 study guide.

Recently, really starting in February ‘14, I started talking to a few of my colleagues at work about the certifications.  I encouraged them to take the DEV401 exam.  One of them did, and passed!  Now, we’re planning to encourage each other in studying for the Advanced Certification multiple choice exam.

I’m starting with the online training offered by Salesforce to customers with certain types of accounts.  My employer has such an account.  I’m taking the training called, “Apex.”  The first few sections seem a touch remedial for me, as I’ve been getting work done with Apex for more than a year, but it’s good review.  And, I can see from the course organization that there are subjects coming up that are largely new to me.

So, there you go.  I’m officially embarking on a study effort with the goal of retaking and passing the multiple choice portion of the Salesforce Advanced Developer Certification.  We’ll see how it goes!

Do not…underestimate…the power…of a good text editor that supports Regular Expressions!

Yes, all my fellow “geeks” out there in the world probably expected the phrase “the power of the emperor,” or perhaps, “the power of the dark side.”  But, stick with me here, and something I learned this week about a great text editor that supports regular expressions might help you in the future.

This past week at work, I found myself dealing with a data issue for our Miami, FL operation.  Basically, we’ve got some data catch-up and cleanup efforts happening for our submissions to one of our contracting agencies.  We upload text files created by an export from our practice management  software.  But, due to a change in our relationship with the agency (we’re now a subcontractor of an agency that now stands between us and the final recipient of the data), we’ve had to change the way we submit our data.  Certain assessments and outcome data that we used to submit directly to the final recipient of the data through their web portal we now must submit via these FTP text files.  So, we had to work with our third-party software development company, Intrepid Services, LLC, to build one new export and update 3 others.   The problem was, there is a fourth export we didn’t touch…and we needed it this week.

Basically, the export builds a simple text file in order to update the Social Security Number (SSN) of one of our clients in the contracting agency’s database.  If we incorrectly keyed an SSN, we use this export to replace that incorrect SSN with the correct one.  Each line item has four pieces of information:  A Contractor ID , the old SSN, the new SSN, and the Provider ID for the agency serving the client. In the past, we would have put the same ID in for Contractor ID and Provider ID because we were a direct contractor with the contracting agency.  Now, we have to put our ID as the Provider ID since we’re a subcontractor, and the ID of the agency for which we subcontract in as the Contractor ID.

So, I was in a jam.  I had to get data uploaded on Friday for us to stay anywhere close to on schedule, and my developer couldn’t build anything fast enough to make a difference.  So, I pulled out my trusty text editor, created an SSN update file from our existing export, and was ready to do a find and replace to correct all the incorrect Contractor ID values in my gigantic text file.

But, OH NO!  Each line has our ID number TWICE; once INCORRECTLY for the Contractor ID, and once CORRECTLY for the Provider ID.  A find and replace would replace BOTH instances of our ID.  What to do!?

Then, I noticed something.  I use a text editor called TextPad, made by Helios Software Solutions.  This editor does a LOT of great things, such as allow you to display line numbers, and it will highlight code for PHP and other languages in such a way that you can tell if you’ve properly terminated strings and ended lines, etc.  You can buy a single user license of this editor for $27, and I’d say it’s a bargain at that price.  What I noticed was a checkbox in the “Replace” wizard of TextPad with a label that reads, “Regular expression.”  In the course of learning to program in PHP, I learned a little about using regular expressions.  Regular expressions are “a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters (Wikipedia).”  I was thrilled.

To make a long story short (I know, too late), I was able to search for ONLY the FIRST instance of the string I wanted to replace on each line by using the following in the “Find what” box of the Find/Replace wizard:

^[0-9-]\{10\}

Let me break down what that means in regular expression (also called “regex” for short) terms:

^:  matches the start of the string the regex is applied to.

[0-9-]:  Anything in between square brackets ([ ]) defines a character class.  Here, I’m saying a number from 0 to 9 or a hyphen.

\: The escape character.  This is a little strange.  Normally, the escape character suppresses the behavior of a special character in regex.  But, because of the way TextPad is implementing regex, I had to escape the curly brackets ({ }).

{10}:  Forget the escape character for now.  In regex terms, {x} means the preceding defined item repeats x number of times.  So, Here I’m saying that any number from 0 to 9 or a hyphen repeated 10 times*.

* These notes on regular expressions borrow from text at http://www.regular-expressions.info/reference.html.

So, ^[0-9-]\{10\} all together means, “Match starting at the beginning of the string any 10 characters so long as the characters are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or –.  Since our ID is in the format of a business tax ID (e.g., 99-9999999) that’s what I needed to match.

In the “Replace with” field of the text editor, I just put the ID of the agency for which we are now a subcontractor.   Then, I clicked “Replace All.”

TextPad treated each line as a separate string.  It replaced the first instance of our ID in each line (which, you’re probably inferred, is at the very beginning of each line), but left the second alone.

Then, in the course of the same project, I realized that I needed to query our database to get some data about a large set of our clients.  The agency had sent us a report with the client IDs for our practice management sofware included.  So, I pasted the list of client IDs into TextPad.  Those client IDs take the form of a letter, followed by 5 digits.  I had something that looked like this:

F00001

F98765

F54637

F65432

And so on…but a lot longer.  To query our database, I needed to get this into a SQL query looking more like

(

‘F00001’,

‘F98765’,

‘F54637’,

‘F65432’

)

But, with this regex feature, that was NO PROBLEM.   I used ^ to match the beginning of the string, and replaced it with ‘.  That didn’t replace the first character, but instead shoved the ‘ in front of the existing string.  Then I used $ to match the end of the string and replaced it with ‘,.  The $ sign is the regex symbol for matching the end of a string.

That got my list so that each line looked something like:  ‘F00001’,

All I had to do was go to the last line, and delete the comma.  Then I had strings encased in single quotes, with each line followed by a comma except the last, which I pasted into Microsoft Query Analyzer on our database server to query for the client data I needed.

I could have spent time carefully cutting and pasting to fix this problem, but it would have taken a long time and I might have made mistakes selecting characters to paste over.  I probably could have gotten creative with Excel and used the data import features of that software to separate the lines of my text file into fixed width chunks ported to separate columns that I then could have updated.  But, regex in a text editor was the solution I stumbled upon that made the most sense.

If you find yourself in a similar spot, give it a shot.  If you aren’t familiar with regex at all, start with a website like http://www.regular-expressions.info/reference.html and learn some of the basics.  You’ll find yourself using this pattern-matching method to solve the most confounding problems with data.  I know I have over the years!

Maintaining balance as a professional 30-something

My job gets heavy sometimes.  I’ve worked two 16 hour days this week trying to help clean up a data problem for a couple of my company’s regional offices.  I’m stressed about deadlines on that project.  I work from home, and have for the past 7 years and 9 months, and I’ve found that makes it a little more challenging to get out in the world and maintain a social life.  Perhaps that challenge is compounded by the fact that I am, by nature, a bit of a computer geek and tend to spend my available social time gaming.

So, what’s the answer?  Of late, I’ve started to think that the answer is scheduling time to be social and do the things I love.  Two summers running, I’ve decided to audition for theatre productions with Music Theatre Louisville, a community theatre in my area.  The rehearsals and run of the show last about 5 weeks total.  I don’t feel like I can commit to a longer period…I worry about problems coming up at work even during that 5 weeks.  But, the great thing is that being committed to a rehearsal schedule forces me to get out of my office, and out of my house, and spend time with people who have a common interest in theatre!

It’s also nice that signing up for a show gets me back to my theatrical roots.  From the time I was in 4th grade until I was about 23, I was constantly in a show of some kind.  I performed constantly.  My undergraduate degree is a BFA in Musical Theatre from Otterbein College.  I made a (pathetic) living performing for a few years after finishing that bachelor’s, and stumbled from a theatre gig at The Lost Colony Outdoor Symphonic Drama into my first serious “desk job;” Director of Marketing for that theatre.  My experience as The Lost Colony’s Director of Marketing lead to another marketing director job for the company for which I now work, the Institute for Family Centered Services (IFCS).  At IFCS, I naturally evolved into working with software and computers, things I’ve always loved.  I went back to school for an MBA with a Management Information Systems certificate from East Carolina University to grow my skill set in that area of management.  Suddenly, I was doing work I enjoyed, but I’d lost my connection to the theatre work that I loved.  Doing shows seems to help me recharge around the stress of work.  What I’m trying to share here is that when I stopped actually making time for the (now) hobby that I love, I stopped doing it altogether.  By committing to shows and talking to my boss and teammates in advance about rehearsal time, I’m finding it’s possible to make time for one show a year.  It presents a bit of a challenge in that I can’t really travel for work during these 5 weeks.  The good news is that modern video-conferencing and telecommuting practices make it to where I don’t have to travel all that much.  Maybe you, reader, can work out a similar commitment to something that makes you happy in a way that doesn’t conflict with your work.

I’m also trying to get on the golf course a few times a week.  That effort has been somewhat impacted by work, rain, and the recital schedule for my wife’s performing arts studio business.  However, I find walking 9 holes of golf after work can make a big difference in keeping my stress level down.  Here’s something my friends and acquaintances around Louisville might now know:  Louisville has an AMAZING set of public golf courses run by Louisville Metro Parks!    The Shawnee Golf Course is right down the street from my house, and it’s pretty easy to walk on for 9 holes without a tee-time after 5 pm…and rates drop at  6pm!

To summarize, I think if there is a “magic trick” to managing stress, it may be to find a few things you love to do that are important to you, and actually schedule time for them.  Put recurring calendar events on your Outlook or Blackberry calendar for them.  Maybe it’s family time, or jogging, or theatre, or golf…whatever the case may be.  Put the time in your calendar, and if you’re anything like me, I think you’ll find that you actually do a better job of taking time for those things.  Your stress level will come down, and you’ll be more effective in all the areas of your life, including work.  “All work and no play…” as they say.  I believe it.