Category Archives: Work

Salesforce Weekly Export Service: Beware the Start of the NEXT Scheduled Export…

Salesforce provides a “Weekly Export Service” for customers with Enterprise, Performance, and Unlimited Editions.  I expect that many of us aiming to use this service as a Salesforce automated backup solution find our way to this “Exporting Backup Data” page in the Salesforce Success Community.  Very clearly on that page, one can read the following about how long those backup files will remain in place once they arrive upon backup completion:  “Zip files are deleted 48 hours after the email is sent. The 48-hour time limit doesn’t include weekends, which means if your download file is ready on Thursday at 4 p.m., that file isn’t deleted until Monday at 4 p.m.”

However, that’s not always the case.  I recently started a new job with a company that’s been using Salesforce for 7 years, and the org has A LOT of data; so much, in fact, that it took 12 days for the first full “weekly export” to arrive.  At least, I THINK it took that long; let me explain why I’m uncertain.  What I learned yesterday is that the initiation of the NEXT export job results in deletion of the backup files from the PREVIOUS export job.  So, I got an announcement at about 10:00 AM on Saturday, 12/20/14, that my export was complete.  On Monday morning, the FIRST business day after the announcement of the export’s completion, I started downloading files at about 8:30 AM EST.  At about 10:00 AM EST, the backup files, all 241 of them, disappeared.  I’d downloaded about 4.

When I called in to Salesforce Premier Support to rave that I should have almost two full business days left to download these files, the rep explained that it wasn’t the 48 hours over business days schedule that resulted in the deletion of the backup files.  It was, indeed, the next export job commencing that caused the deletion.

The solution I was pitched was to delete the weekly scheduled job, and allow the currently executed job to complete.  Then, when that job finishes and my team has downloaded all the files, we can manually kick off our next export.  That should prevent this problem moving forward, but it adds another point of opportunity for human error in maintaining the backup process, about which I’m not thrilled.

The truth is, this discovery is just one more factor that is increasing the urgency of figuring out an automated backup solution for our Salesforce org.  We need a frequent backup to protect us against data losses / corruptions caused by human error.  Yes, Salesforce backs up data for “disaster recovery purposes,” but make sure you read up on what that means.  According to Salesforce, it costs a minimum of $10,000 (US) and “and usually takes a minimum of 15 business days (3 calendar weeks).”  I don’t know about your company, but 15 days waiting for a data restoration in any emergency that would justify a $10,000 fee would be WAY too long to wait for us.

I’m curious about what other users with large amounts of Salesforce data have done to automate a frequent backup process.  I’m looking at scripting with Salesforce DataLoader, I’ve started experimenting with the Jitterbit Data Loader, and I’m open to just about anything.  If you have any thoughts on the subject, I’d love to get a comment from you here.  Thanks in advance!

Salesforce DataLoader Error: The sobject initialization failed…

I encountered a really strange issue today when trying to export data from Salesforce using DataLoader.  In Step 2 of the export process (the “Select Data Objects” step), for many of  the objects in my company’s org, I was getting an error message that read, “The sobject initialization failed.  Please try again,” when I would select the object and then clicked, “Next.”  I tried everything I could think of to fix the problem.  I checked object access levels in Salesforce.  I tried uninstalling and reinstalling DataLoader (version 32).  I tried restarting my machine.   None of it worked.

Then, I tried another machine that had DataLoader installed.  It was version 30, and it worked.  Sadly, though, the version difference was a red herring, and had nothing to do with the problem.   I installed version 32 on that other machine, and it still worked.  So, that led me to think their was some issue on the other machine preventing DataLoader from properly initializing some SObjects.

My Google searches for the error message didn’t yield much, but I did find my way to a labels.properties file in the GitHub space for the DataLoader project.  In that file, I saw the error message I’d been searching for on Google:  “The sobject initialization failed. Please try again.”  That made me think, “Hey, DataLoader is built in Java.  I wonder if this failure has anything to do with my Java installation.”  I actually have multiple versions of Java on the machine.  My system path had both of the following references:

C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\Java\jdk1.7.0_71\bin;

I thought to myself, “I wonder if the multiple versions of Java are messing things up.  So, I removed the second of those two entries from my path variable, restarted DataLoader, and the I was then able to get past the point where I had been getting that error message.

Here’s the funny part, though.  After I had succeeded, I put my path variable value back to what it had been previously.  I had pasted it into Notepad++ so I could restore it afterword.  I closed and reopened DataLoader…and I could still initialize the SObject that was failing before.   So, I restarted my computer, confirmed that the path was what it had been originally…and I STILL didn’t get the error.

Frankly, I can’t explain exactly what’s going on here.  But, changing the path entries for Java as I did seems to have resolved the problem. If you encounter this problem and have multiple versions of Java, you might try removing one of the installation paths from your system path variable.

For reference, here are the Java versions on that machine:

Java 7 Update 67
Java 7 Update 71 (64 bit)
Java 8 Update 25
Java SE Development Kit 7 Update 71 (64 bit)

I now post this in the hope that it will save some developer / administrator out there in the world the hours of troubleshooting I just went through…

I Passed the Salesforce.com Certified Force.com Advanced Developer Programming Assignment and Essay Exam!!

It’s been awhile since I made a Salesforce post.  I’m so happy to be able to make this one.  I feel so grateful, blessed, and humbled right now.  About four weeks ago, I was given an amazing new job opportunity with a company called ACI Worldwide as a Salesforce Architect.  They brought me in knowing I had a lot to learn to really live up to that title, but that I was passionate about the Salesforce Platform as a Service, and want to learn as much as I can about anything and everything that can be done with it.  I’m very excited about this chance to learn, but it’s pretty intense right now as I’m surrounded by a new business context and a lot of new ideas.  Tonight, right when I could use a bit of a pick-me-up as I’m working hard to learn fast and add value quickly in the new job, I found out that I PASSED the Salesforce.com Certified Force.com Advanced Developer Programming Assignment and Essay Exam on my first attempt!

I couldn’t have done this without all the encouragement I received from my former colleagues at The MENTOR Network, in particular Kate Miller, Shaun Wood, Bridget Samuel, Paul Perisic and Jeffrey Cohen, among many others.  They may never see this post, but I want to record my gratitude for the encouragement and assistance they provided as I was learning Salesforce and diving in to the certification process.  And, frankly, I want to thank Dan Appleman and Jason Ouellette.  Their books on advanced apex and Force.com platform development, respectively, are the resources that I think most helped me make the transition from intermediate-PHP-MySQL-Web 2.0-self-taught developer to someone able to pass this programming assignment.  Thank you to the review panel who graded my programming assignment for their comments, including the constructive criticism included therein.  Mostly, though, I want to thank my wife, who pretty much got used to me getting done with work, grabbing a sandwich, and going right back to my home office for most of the month of October 2014.  She picked up a lot of slack as I was focusing on the programming assignment, and I’m very grateful.

Now, back to that constructive criticism from the review panel, since anyone prepping for the Advanced Developer certification process who actually found their way to this blog post from a search engine result deserves at least an attempt from me at providing helpful information.  I don’t even want to brush the edges of sharing any proprietary information about this certification programming assignment because I worked WAY too hard to risk losing it for an ethics violation or anything like that.  So, I’m going to have to speak in pretty generic terms.  But, what I feel comfortable saying is that the comments really weren’t that unexpected, and I think they were very fair (even the negative ones, which aren’t ever really easy to get, but I’m focusing on the chance to improve that they represent!).  They focused on Salesforce best practices, that are documented all over developerforce.com, the success community, etc.  There was one comment that I should have expected.  When I was approaching one piece of the assignment, I thought to myself, “I wonder if I can do this with [a piece of standard Salesforce functionality] rather than with this cool, but perhaps over-engineered, chunk of code I’ve written.”  If you find yourself thinking something like that, stop, and go read the pertinent documentation!  That thought leads me to the two pieces of advice I would give to anyone preparing for this certification:  1)  Read Development with the Force.com Platform by Jason Ouellette and Advanced Apex Programming by Dan Appleman, and 2) remember that you’re being tested on THE SALESFORCE PLATFORM.  As you’re designing your solution, think about what Salesforce has done to make certain things easy for you as a developer, and make sure you’re not writing code to solve problems they’ve already solved.  I was “guilty as charged” on that count for one thing, and I’m going to go back and think my way through the “better way” that was described in my comments.  Thank you again for the feedback, review panel, whoever you are!!

Actually, one more thing:  The certification website and other sources on the web have language like, “Plan at least 20 hours for the programming assignment, but be ready to possibly spend more to do a good job…”  I guess I have a third piece of advice for folks going after this one:  Unless you REALLY know what you’re doing, I’d at least double that 20 hour estimate.  I read the assignment the first night, read it again the next day, did some thinking / planning / design, then started coding.  I think, in the end, I put in more like 50 hours.  I grant you, some of that was in obsessing, reworking a bad design choice I caught last minute, etc.  I also seriously underestimated the amount of time it would take to write test code for EVERY permutation I could think of for use of the simple interface, and truthfully, I left some positive and negative use cases untested simply because I ran out of time.  I think I got to 98% or 99% code coverage, and I’m proud of that, but the funny thing about getting code coverage that high in this context is that the handful of lines I couldn’t cover DROVE ME CRAZY!!!  There was one line of Apex code I tried to cover about a dozen different ways, and finally had to give up.  I was SURE it was possible to cover, but for some reason my usual bag of tricks wasn’t cutting it.  Ah, well; I’m proud that I was more focused on testing every use case I could think of than just getting the code coverage.

OK, call it FOUR pieces of advice, since I think this is just restating a Force.com development best practice and doesn’t give anything away about the assignment:  Don’t be lazy; actually DO the “worst case” analysis we all know we should always do to determine if a solution will scale BEFORE you start coding.  I caught a design flaw in my assignment two nights before it was due because I went back to the beginning of the prompt and decided to think my way through the whole thing one more time.  Had I not done that and caught the issue to which I’m referring here, I’m almost certain I would have failed.

Good luck to those of you pursuing this certification!  It’s hard work, but it feels great when you pass, so go for it!!

 

dev copy dev_adv

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.

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.