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:

1{!$Network.Name}
2{!$Network.NetworkUrlForUserEmails}

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:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_network.htm

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(); 
2  
3  attachmentProductInfo.Name = 'PRODUCT_INFO.xml';
4  attachmentProductInfo.Body = Blob.valueOf(xmlFinalProductList); 
5  attachmentProductInfo.ContentType = 'application/xml';
6  attachmentProductInfo.ParentID='OBJECT_ID';
7
8  try{
9   insert attachmentProductInfo; 
10   }catch (DmlException e) {
11  System.debug('The following exception has occurred: ' + e.getMessage());
12   return e.getMessage();
13  }
Page 1 of 212