Go Falcons!

It’s 2017. I may be slacking on site but I will be hitting it hard soon. In the meantime celebrate! Because the Atlanta Falcons are going to the Super Bowl!

New Year’s Resolutions

We are into a new year. 2017. Boom! And so far it’s going ok.

Like everyone else I make New Year’s resolutions. This year though I am making mine more career oriented. Every year they usually are but this year I really plan to amp it up and be more focused. I really want to bring things to the next level. So, here are my resolutions for 2017:

Creating TrialForce Orgs in Specific Regions via Community Hub

If you use Community Hub then you are familiar of spinning up TrialForce orgs for whatever reason. My use has been spinning up TrialForce orgs for demoes and training purposes.

When I spin up TrialForce orgs they are created on the US nodes. But what if you want the TrialForce org spun up on an EU node or Asia node?

The solution is simple.

A TrialForce org will be spun up on the region specified based on the User’s locale making the request. So, if I wanted a TrialForce org on a EU node at the user level change the locale of the user to a country in Europe. Then create/request a TrialForce org from Community Hub.

Global Merge Field Type for Communities

I had a task to create an email template that was for using with communities. However, when creating a email template and using merge fields there are currently none available in the UI for communities.

The solution?

Well, it may not be available merge field in the UI there is a $Network merge field type that can be used and embedded into an email template. It  has two values that can be used:


This is all I needed for my task though I wish there were more available fields that could be used.

To read more click here:


Twitter Clutter

When Twitter first came out my reaction was ‘I get it. I also don’t get it.’ You got 140 characters to say something. People are going to follow you are not. Simple as that. They want to hear what you got to say. These people can be the most random individuals you will never ever meet (granted they are real to begin with). But it was the newest social media tool to be on at the time. So, yeah I created an account or two and began tweeting away.

Attachment To Object in Apex

In an earlier post, Generating an XML file in Apex, we created an XML document Xmlstreamwriter class. This post we will take the XML and attach it to an object. The code to do so is pretty straight forward:

1  Attachment attachmentProductInfo = new Attachment(); 
3  attachmentProductInfo.Name = 'PRODUCT_INFO.xml';
4  attachmentProductInfo.Body = Blob.valueOf(xmlFinalProductList); 
5  attachmentProductInfo.ContentType = 'application/xml';
6  attachmentProductInfo.ParentID='OBJECT_ID';
8  try{
9   insert attachmentProductInfo; 
10   }catch (DmlException e) {
11  System.debug('The following exception has occurred: ' + e.getMessage());
12   return e.getMessage();
13  }

MailChimp Sent 1.5 Billion Emails on Black Friday

MailChimp just posted how they sent 1.5 billion emails through their system on Black Friday. It was followed on Cyber Monday with 1.4 billion emails. You can read more about here:


Those are pretty impressive numbers!

Generating an XML File in Apex

I recently had the task to create some XML files based on object data and create an attachment. I’ve created XML files before in say Ruby and PHP but not in Apex. This was new to me and in the end was an easier task than I thought it would be.

First let’s create an objective. We want to create an XML file that has the following format:

1  <?XML encoding="utf-8" version="1.0" ?>
2  <catalog>
3   <product id="bk101">
4      <author>Mix Master Mike</author>
5      <title>XML In Apex</title>
6      <genre>Salesforce</genre>
7      <price>1444.95</price>
8      <publish_date>20016-12-10</publish_date>
9      <description>An in-depth look at creating applications with XML.</description>
10   </product>
11 </catalog>

This seems simple enough.

Page 1 of 212