Strategic impact and making multi-level relationships look nice

Last Updated on Wednesday, 5 May 2010 02:08 Written by Steve Wednesday, 5 May 2010 02:03

I’ve been doing a little prototyping in Salesforce.com as a volunteer project for a nonprofit in town. They’ve got an interesting need to track their strategic plans in Salesforce. I’ve seen this kind of thing built many times and have built it myself for another org or two. For this org they’ve got 3 levels of custom objects to hold their data. Driver is their high-level strategic focus. Goal is the next level down–there can be many goals for each Driver. And Metrics our measurable things related to each Goal.

Salesforce lets you create these objects and relationships between them very easily. I created the schema in just a few minutes. I created three objects and related them together–in this case I made them master-detail relationships. You can see in the diagram what my schema ended up looking like.

Now tracking your strategic goals is great, and most nonprofits do that. But where I think it gets more interesting is when we can tie the actual work we do directly to the metrics we’re trying to deliver on. So you’ll see in the diagram that there is a 4th object called project. Project is used to track all the work efforts of the org that are worth recording. I created a lookup relationship from Project to Metric so every project this groups takes on can be explicitly related to a Metric we need to deliver on. Which is in turn related to a Goal, which is related to a Driver. So, why are you updating that website for the 100th time this year? Because the website Project is meant to deliver on the Metric of increasing engagement of our supporters 25%, which is part of a Goal to grow the direct impact our supporters have in the world, which in turn feeds our Driver which calls for us to lead the world with a model of catalytic impact.

Those strategic objectives are made up for this example, but you get the idea how daily work can roll up to why your organization exists. Seeing that direct relationship can be very powerful. So when you look at the Project record in Salesforce, what do you see? Because there is only a relationship to the Metric object, you only see the Metric on the page layout.

Because the Project isn’t directly related to Goal or Driver, we can’t have lookup fields to those objects. Lookups are only for direct relationships, from child to parent, not up to grandparent and beyond. So we need another solution, and it turns out to be formula fields. On the Project I can create a Goal field and a Driver field that are formula fields of type Text. Here’s the formula for each of them:

for Goal: HYPERLINK("/" + Metric__r.Goal__r.Id , Metric__r.Goal__r.Name,"_self" )
for Driver: HYPERLINK( "/" + Metric__r.Goal__r.Driver__r.Id , Metric__r.Goal__r.Driver__r.Name,"_self" )

We’re creating a hyperlink to fake a real lookup. The URL of the hyperlink is relative, so it starts with / rather than http://. It then has the Id of the object, which we get by traversing up the relationships in Salesforce. From project we follow the Metric__r relationship to the Metric object, then up the Goal__r relationship to the Goal where we can grab any fields we want. With Driver we do the same thing, just go up one more level. If you think this looks hard, don’t worry, the formula field editor is really easy to use and does all the hard work for you–you just click the relationship you want to traverse.

The text of the link is the Name of the object in question. And then we target the hyperlink to “_self” so that it will load the record in question into the current window–just like a regular lookup would.

After adding these formula fields to the page layout, the end result is this:

Now we’re telling the full story about this project with a little help from simple formula fields.

Learn More

Medical Records for Gitwe

Last Updated on Thursday, 20 May 2010 03:20 Written by Steve Thursday, 18 March 2010 01:37

My trip to Rwanda was amazing. This first post is going to be about the volunteer project I was a part of. I’ll write more later about Rwanda and the people. There is so much to say…

Gitwe hills

First of all, our project team fully delivered on all we set out to do. While success was in doubt up until the last minute (why do I work in technology?) we pulled it out at the 11th hour. Literally–11pm the night before we left. I look at what we did and we really nailed every aspect. The hardware we brought is high-quality and well configured. We got all the server software running in the configuration required. The electrical infrastructure is sound and protects the hardware. And we documented the systems very well.

It was really interesting going to Rwanda, such an amazingly different place from where I live, and then spending a lot of time working with technology. Every day felt like two days. There was the experiential part–meeting people, taking in the bustle and beauty, and eating amazing food. And then there was the volunteer work. Every day we were focused on moving toward project success. It made for a trip that went by quickly, but at the same time seemed to be a month long.

And I wouldn’t do it differently. I highly recommend going to Rwanda and Kenya. And I really recommend going there with good work to do. Volunteer. Help out. Contribute to the country while you experience it. You’ll get more out of your time there. You will spend more time with Rwandans and Kenyans. You will connect deeper with the place and the people then you would as a tourist. When I go back to Rwanda, I will be going with some good work to do. Maybe technology related, maybe not. But this kind of travel really resonated with me.

Here’s a quick recap of the project and why I was there:

Medical Missions for Children sends doctors to the hospital in a town called Gitwe a couple times a year. These doctors volunteer their time and perform surgeries on kids and adults. Things like repairing cleft pallets and resectioning goiters. Surgeries that are common and easy in more wealthy countries, but just don’t happen in poorer places. These cosmetic surgeries can be absolutely life changing–much like the impact of homeless people getting free dentures in San Francisco. It turns out that these kinds of procedures can change people’s lives–giving them confidence they’ve lacked for years because of their limitations. The freedom to smile, and not feel self-conscious, re-connects people with society and their families in profound ways. These cosmetic procedures can be truly life-changing.

Lucky Gunasekara was the project lead and he assembled the team–me, Jordan Smock, and the incomparable Canadian, Dale Zak. I didn’t know any of these guys going into the trip, and I came away with real friends I know I’ll stay in touch with.

Our task on this trip was to install a computerized medical records system that could be used by Medical Missions for Children to record the patients they worked with. When you’re performing surgery, it’s really important to know the patient’s medical history so that you don’t inadvertently harm them with drugs they are alergic to, for example. Phase one of this project was to get the system in place and have MMFC use it after we left. Phase two is for Gitwe Hospital to use the medical records system more broadly–allowing for better care for the 300,000 people who turn to the hospital.

Gitwe Hospital is owned and operated by the wonderful Urayeneza Gerard. He was our gracious host during our time there. Everything we requested to get the project done–server room with a padlock, upgrade to the electrical system, curtains for the windows–was gotten on short order.

Because of limited prep time for the trip, we purchased the hardware in the US and carried it on the plane with us. 2 Netbooks, 2 small desktops, a server, a backup power supply (UPS) and a million cables, surge protectors and other miscellany. Surprisingly, everything made it to our destination safely, and worked when we unpacked it. We did the unpacking in Kigali, where we were more confident we would have reliable power and Internet access. One of our hotel rooms turned into a makeshift server room as we built up the hardware, the network, and the software.

The biggest issue we ran into while unpacking things was power. Rwandan power turned out to be reliable and clean, but it comes out of the wall at ~250V. The power supplies in all of our devices were rated to 240V, save the most important one, the UPS. Luckily that required an awesome day of walking around the commercial district searching for a solution. We found one with the amazing folks at Bricotech. They sold us a voltage regulator which would serve the dual purpose of stepping the voltage down to 110V and protecting our equipment against power fluctuations. They also put a British plug end on our UPS, solving our other issue.

We were now ready to leave the big city for the rural outpost of Gitwe. We packed all our gear and made the 2+ hour drive south to the hospital, stopping along the way for a Mutzig in the van.

Gitwe is an amazing little spot. It’s not really a town, more of a collection of shops and homes. The main centers of activity are the Hospital and Esapac, a technical school with about 1000 students. So while it was a tiny little place, it bustled with activity of people coming and going.

Over the course of five days we took an empty room at the hospital and transformed it into the Gitwe Hospital server room. Here are the before and after pics:

We worked side by side with the IT staff at the hospital–Innocent and Charles, setting up furniture, hardware and software. The technology we brought in is somewhat new to these folks. They haven’t used the medical records system before, and they need to come up to speed on Linux systems. We’re hoping to get them involved in an intensive nine-month training course offered by the Rwandan government to train folks to work with medical records systems. It’s a plumb placement, and a great opportunity if it comes through.

OpenMRS was our steepest learning curve in this project. We ended up running up against a problem with a bad install file posted to their website. Things just weren’t working for the first 3 days of our stay. We tried every angle we could think of, and then used our cellphone modem Internet access to throw a hail mary out to Dave Thomas, who works at the other end of Rwanda for Partners in Health. He saved our bacon. Completely. With his help, we were able to get the system functioning on our last day, and then spent the rest of the day and night configuring it for the special needs of MMFC. At midnight we headed back to our rooms for a beer, a bit of whiskey and Coke, with a palpable sense of relief and accomplishment.

The next morning we had breakfast with Gerard and his wife Justine, like we did each day in Gitwe. After breakfast Gerard said a prayer for our travels and really got us choked up as we realized how important this contribution is to him. He’s doing amazing things for Gitwe with the school and the hospital. He is by far the largest employer in the area, with the hospital alone having 1,500 employees. And he has no plans to slow down–Gitwe will likely be the home of the second medical school in Rwanda. I can’t wait for that to happen!

Now that our work was done, we could enjoy a little tourism. But, Lucky, Dale and I aren’t your average tourists. What we like to see are real people, and amazing good work. So, naturally, we headed up to Rwinkwavu to get a tour of the Partners in Health operation. It was the most amazing download of information I’ve had in a while. Hearing about the innovative things they are doing to ensure the health of the poor in northeastern Rwanda was nothing short of amazing and inspiring. PIH is my favorite nonprofit, and I highly recommend reading Mountains Beyond Mountains if you want to learn more about how comprehensive healthcare can be provided to people with no money. Thanks to our hosts Cheryl and Dave, we had plenty to think about on the long drive to Kigali.

I can’t say enough about the experience of working side-by-side with great folks in an amazing setting. It’s a great feeling to visit a place and leave behind something of value that can be built on. I hope to go back and contribute some of that building. I’d love to have more time to focus on knowledge transfer and skill building with Charles and Innocent and whomever is interested. This trip felt like a first step into a longer relationship. I hope that’s the case and that Gitwe moves forward as fast as we all want. There are governmental plans to bring fiber optic Internet to all the district hospitals in the next year or so. Gitwe could be transformed in short order if that’s the case. I’d love to witness it first hand!

Learn More

An Introduction to Exception Handling in Apex

Last Updated on Tuesday, 12 January 2010 10:48 Written by Steve Tuesday, 12 January 2010 10:48

I was privileged to get to write an article for DeveloperForce.com on exception handling in Apex. I wrote this article not from the perspective of an expert on the subject, but as someone who really wanted to learn more about my options for using exception handling in my Apex code.

I’ve always had a nagging feeling that I wasn’t following best practices in my exception handling in Apex. In most cases I wasn’t doing any exception handling at all. I decided to write up what I have learned about error handling on the Force.com platform so that others could jump into it full-bore, and make their programs more robust and fault tolerant.

I hope it’s helpful to Apex programmers out there. Let me know what you think!

Learn More
Copyright © 2009 Afterburner - Free GPL Template. All Rights Reserved.
WordPress is Free Software released under the GNU/GPL License.