Sunday, January 21, 2018

Test Class for your Marketing Cloud Trigger

When using the Salesforce Marketing Cloud Connector to enable Marketing Cloud access from Sales and Service Clouds, folks often want to perform a triggered send when a specific event occurs. To do so, one must create a trigger on the desired object.  For example, let's say you allow loyalty signups from your web site. Upon signup, you create a new contact record in Salesforce Sales Cloud. Best practice is to send an email to the user right away. This gives users a level of confidence they actually signed up. You might also want to send a verification link, etc. However, let's keep it simple.

First, create your trigger on the Contact object. This must be named "Trig_Contact". Follow these instructions.

OK. Now I'm assuming you did this in a dev org since you can't create it in production. At this point, you're probably wanting to deploy your simple trigger to production so you can go on and create your send definition. Here's where you run into a problem. Salesforce kind of forgets to mention you need a test class.  To make matters worse, you might not be an APEX developer... so this is going to be fun.

If you want some background on test classes, read this help article.

Back already? Awesome. Let's get to it and create that test class.

  1. From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes and click New.
  2. In the class editor, add the code below as the class definition, and then click Save.

@isTest
private class Trig_ContactTest {
static testMethod void myUnitTest() {
// TO DO: implement unit test
Contact testContact = new Contact(LastName = 'Test Contact', Email ='help@chrisbeckworth.com');
insert testContact;
testContact = [select Id, LastName from Contact where id = :testContact.Id];
System.assertEquals(testContact.LastName, 'Test Contact');
}
}
Great. Your all set. Now you need to make a changeset with your Contact trigger and test class. Upload that changeset to Production. Go into Production and deploy the changeset. Make sure, when deploying, to select the last option to only test items in the changeset.

Here's how to set up the send definition.
Here's more info on triggered sends in general.

Saturday, May 14, 2011

Start Rubbin'

Garlic and Mustard Dry Rub

1 tablespoon garlic powder
2 tablespoons ground black pepper
1 tablespoon salt
1 tablespoon mustard powder
1 tablespoon chili powder
1 tablespoon ground cumin
1 tablespoon brown sugar
4 tablespoons ground paprika
1/2 teaspoon dried oregano

Just mix it all together and then rub on steak. Then let the steak come to room temperature before grilling. Enjoy!

Wednesday, September 29, 2010

No Loss Situation

It’s a no loss situation; this means absence of any competing or non-competing losers. It’s like tee ball with no score and where every kid gets pizza, a snow cone, and the same “League Champs” trophy.

This is different from the clichéd "win-win" situation. If there are winners then there is at least 1 loser.

No loss is far better than win-win. Plus it's cliché worthy.

Tuesday, August 10, 2010

My Best Hummus

1 can (15 oz) garbanzo bean (chick peas) drained*
1/8 cup tahina paste
1/8 cup extra virgin cold pressed olive oil
1/2 tsp kosher salt
1/4 tsp paprika
1/4 tsp cumin
half a fresh lemon
some white pepper
crushed red pepper (garnish)

I usually make a double batch.

Instructions. Drain the beans, conserving the "juice." Add the beans, tahina, olive oil, salt, paprika, cumin into your blender. Squeeze the juice out of the lemon. Dash some white pepper in on top. Grab a wooden spoon or silicon (or rubber) scraper. Turn on the blender at it's slowest setting. Gentle push from the edges into the center just staying on top of the ingredients. Everything will blend. If it's too chunky add either (a) more olive oil (my preference), or (b) some of the "juice" you conserved.

I blend mine in my Kitchen Aid blender until I get to second highest setting and leave it on until the humus is light and fluffy; almost whipped. Everyone loves. Lately I've been adding some fresh garlic. Also, a teaspoon of truffle oil instead of garlic would be a gourmet touch.

Keep it simple. Serve directly on a plate in a big dollup drizze with a touch of olive oil and garnish with crushed red pepper. I like to use barbari bread from my local mediterranean market and it can also be found at Sam's. Pita bread is fine. Try your favorite flat bread. I cut mine in 3 inch square, warm in my counter-top toaster then cut into triangles.

Enjoy!

Monday, March 10, 2008

Strawberry Pineapple Smoothie

Here's a great lactose free shake I make for my wife. I say it's lactose free because it has no milk, but it does have yogurt. I use Activia. My wife has found that the Activia does not cause the same problems other milk products do.

Put the following items into your blender in this order:
1 cup of frozen strawberries
3/4 cup of frozen pineapple chunks
1/2 cup of plain or vanilla Activia yogurt
1/2 cup of rice milk
1 scoop of egg protein (vanilla or unflavored) we use Jay Robb's
some honey to taste

Wait... don't leave. When you blend, start at stir and move to liquify. Don't start on high. Pro smoothie machines do just that; go from slow to fast. It makes less mess, wastes less, and blends smoother AND faster with less air.

Enjoy.

Sunday, February 24, 2008

Sunday, January 27, 2008

Those Poor Hens

Below is a picture of the latest marketing trend for eggs: honesty in
what the hens a fed. However, I have to say I'm a bit appalled. Look
at what they claim to be feeding them!

Wednesday, December 19, 2007

Gnocchi with Talapia in White Wine, Mushroom, and Roasted Red Bell Pepper

OK, here's a quick narrative of how to make this dish. There is no recipe, just some guidelines.
I sauteed the fresh frozen talapia for 4 minutes a side on medium-ish in EVOO with kosher, cracked, and squeeze of lemon; then set it aside.
Into my already boiling water, I dumped premade gnocchi. After 5 minutes, I drained and set it aside after a cooling rinse.
Then I sauteed mushrooms in olive oil, white wine, cracked, and kosher. After the mushrooms were cooked, I sliced and added in 1 red bell that was from the olive bar at Tom Thumb - roasted and in olive oil.
Next, I added a little more kosher, cracked, fresh Italian parsley, and diced romas, tossed quickly and removed from heat.
Following that, I took out a big as pan, put it on medium, threw in the gnocchi and drizzled with EVOO and sauteed those suckers until they were warm again and not as doughy, threw on the mushroom sauce, then diced the fish and added it in... toss toss toss.
To plate, I garnished with crumbled feta, Parmesan, and some fresh Italian parsley and cracked for looks.
This is a totally made up dish.
After scarfing it down we concluded that I should have added toasted pine nuts and a lemon wheel into the mix.
I think some crushed red pepper in the sauce after the mushrooms would have been spot on!
Enjoy!

Tuesday, December 11, 2007

Stop Making Mud and Clear Up Your URI

Do you use a custom domain with Blogger like I do? Well I find that the help at Blogger is pretty good. There's info on how to setup the DNS etc. And, if you're like me and wrap your domain with Gmail and Google Calendar then you have email.yourdomain.com resolving for email and cal.yourdomain.com resolving for the Calendar.
However, you may have noticed that while www.yourdomain.com brings up your blog, yourdomain.com (without the "www") does not. What to do? Well if you are on Linux/Apache and hosted somewhere, time to make a quick and dirty little .htaccess file.
Make a text file called htaccess.txt. Put the following code in there:
#chrisbeckworth.com rocks visit often
Options +FollowSymlinks

RewriteEngine on
rewritecond %{http_host} ^yourdomain.com [nc]
rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]
Replace "yourdomain.com" with domain name and tld. Save the file. FTP to your domains directory and uploaded the file. Rename the file from htaccess.txt to .htaccess.
Enjoy.

Wanna Learn Regular Expressions?

I'm a big believer in less is more. To me, regular expressions are the eptitomy of that in slinging code. Finally found a good primer. Now if I can only find the time to read and practice. I have the same problem with my grand piano.

Thursday, December 6, 2007

Little Antique Santa


Here's an antique Santa from who knows when or where. My mom came across these when I was 12 or 13 and had packs of them. I remember her using them to decorate the big gifts and hanging here and there about the house for a little more Christmas spirit. They are all my favorites but you can decide which is your as I update the post.

Merry, merry!

Tuesday, November 13, 2007

Super Fast Curry

This is not one of my wife's favorite rice bowls. But, it is still quick and easy as all of them always are. Combine all of the ingredients in your big rice steamer in the following order:

  • 2 cups long grain white rice
  • 1 lb diced raw or frozen chicken
  • 16 oz (1lb) package of frozen 3 peppers and onions blend (red, green, and yellow bell peppers with onions)
  • Maybe some corn or brocolli if you like. Snap peas are cool to. Whatever you like
In a measuring cup add:
  • 3 teaspoons of your favorite curry spice
  • 1 cup chicken stock
Stir the contents of the measuring cup then pour over the stuff in the steamer. Now get all the good stuff out by filling the same measuring cup 3 more times so that you add:
  • 3 cups of water
To be sure, we've added a quart of liquid to the steamer in total. Also... NOTHING is sitting in the steamer tray. This is all simply piled in together. Now, close the lid, click on the steamer, go do something else.

Enjoy.
--
Chris Beckworth

Tuesday, November 6, 2007

"Did I do that?" asks Lillie.

A lesson was learned today. Do not leave your bucket of shredded paper where a 2 year old can get to it.

Wednesday, July 4, 2007

True Patriots on the 4th


Happy Fourth of July, 2007 Everyone. In the photo, here are Halley, Hannah, and Preston. Three really terrific young people I met on my inaugural July 4th ride; i.e. the first time I can recall riding on the 4th instead of going to a boring party.

Now about these great Americans you see here. What you don't see is that they are cousins. I wish I'd hung out with my cousins more growing up. I hope my son does. He has some great cousins waiting for him on both sides. Make sure your children spend time with their cousins. Family is important. Friends come and go, but family is always there until it's too late. Think about that.

In the background of this photo is an awesome mother holding attention of the other half of the dog you see on the left. I believe she's Preston's mom; maybe not. Either way, good for her and their Dad (who built the lemonade stand). They said that "Dad insisted on building the stand" or something to that effect, but I know what lesson he is teaching. A job worth doing is a job worth doing right. I agree. You can't just set up a card table, sell lemonade and call it a "stand." If you are going to have a Lemonade Stand then build it. I hope for the same tenacity as my children age. Teaching your children values is the number one task of parents.

With the rain, they may have not had the number of customers they should have, but it was a success in many more important ways.

Friday, June 22, 2007

Race to 100

We all make life goals big and small: start a business, win a professional sporting event, make a million dollars, eat an extra-large Gecko pizza all by yourself. One that I've had for a long time is very simple. Do 100 push-ups in a row; no breaks, no stopping. I figured if I could do that I would be in pretty good shape, or at least relatively strong. I always wanted to do this before kids came along. With John Cannon's impending arrival, now is my last chance! To meet this goal I am doing previous day's amount plus 1. Yesterday was 27 and today will be 28.

There is still time for you to get in on the fun. Just check out the schedule below and keep up. Is it silly and nerdy? Hell yes it is. However comma, it is kind of fun. Every night, before we eat, I get down on the ground and do them. Kristina counts. John Cannon kicks. I push. Good lessons learned by all.

Race to 100 Schedule


Friday, June 15, 2007

Siebel eScript Now() Function

There is no "Now()" function in Siebel eScript but you can write your own to return the current date/time off the server. Here's how it goes:

function Now(){
var dtNow = new Date();
var sNow = ( dtNow.getMonth()+1) + "/" + dtNow.getDate() + "/" + dtNow.getFullYear() + " "
+ dtNow.getHours() + ":" + dtNow.getMinutes() + ":" + dtNow.getSeconds();
return(sNow)
}


Note
  1. You should use SetFormattedFieldValue() if you are planning to use this on a business component field.
  2. This function returns server time. You may need to make adjustments based on local time for the user.

Wednesday, May 30, 2007

Tips for Choosing a Home Inspector

<I forget where I found this but it made sense and I used the questions... for the most part>
= = = = = = = = = =
The home inspection industry is plagued by incompetent inspectors. Most states do not require licensing. (Texas does) Anyone can call themselves a home inspector. Therefore, it is important to screen and qualify an inspector before hiring him. It is well worth the effort to find a seasoned professional. The following questions can assist you.

1. Is the inspector experienced?
2. Is the inspector knowledgeable?
3. Who referred you to the inspector?
4. Which inspector will the inspection company send?
5. Is the inspector covered by errors and omissions insurance and general liability insurance?
6. How long does the inspection take?
7. How much does the inspection cost?
8. What type of report do you get and when do you get it?
9. Is the inspector affiliated with any organizations?


Is the inspector experienced?

A full-time inspector who performs 250 or more inspections per year and has many years experience is most desirable.


Is the inspector knowledgeable?

An inspector must have full working knowledge of every system in a home. Most inspectors had formal training in just one trade. To become inspectors they had to cross-train in all the other relevant trades. The more knowledgeable inspectors started with a degree in a field such as engineering or architecture that provides a broad background in general construction or they were trained to operate as a general contractor. These are good bases to build from. One does not acquire this kind of knowledge by taking a few courses or reading a book. A good rule of thumb is to look for fifteen years of combined formal training and on-the-job experience in related fields.


Who referred you to the inspector?

The best referral is from someone you personally know and trust who was satisfied with the inspector's performance. Although many real-estate professionals refer quality home inspectors there is a possible conflict of interest with this type of referral. If you were not reliably referred to the inspector then ask for references from past clients, preferably from several years past.


Which inspector will the inspection company send?

When dealing with an inspection company the reputations of both the company and the inspector who is assigned to your home are important. Request that an experienced inspector be assigned rather than a new one.


Is the inspector covered by errors and omissions insurance and general liability insurance?

It is to your advantage that your inspector has this coverage. Do not be afraid to ask for a copy of the policies.


How long does the inspection take?

Ask how long the inspection will take and how many other inspections will be performed on the same day as yours. If the inspection takes less than 2 hours find another inspector. Performing a thorough inspection is very tiring, so arrange to be the first or second one of the day.


How much does the inspection cost?

This is one area where you do not want to nickel and dime. A well-established, full-time professional inspector is going to be at the high end of the spectrum. Several hundred dollars is a small price to pay to get the best protection you can for perhaps the biggest purchase of your life.


What type of report do you get and when do you get it?

You may want to ask this question since there are several answers. An inspection should include a signed report that describes what was inspected and the condition of each inspected item. Some inspectors use a checklist type of form with stock responses. Other inspectors simply provide a written description of the conditions found. A modern alternative to these are computer-generated reports. The best of these are generated by advanced home inspection software systems and include comments specific to each home.

An important question to ask is, "When do I get the report?" The checklist type and the handwritten type are usually delivered to you on-site. Computer-generated reports are also available on-site from a few inspectors who bring a portable computer to the job. Otherwise, the inspector mails the report . You may want to know up front how long you can expect to wait for it.


Is the inspector affiliated with any organizations?

There are many local, state, and national organizations that an inspector can join as well as many franchises that an inspector can purchase. However, membership in any organization does not guarantee a quality inspector. In the end, the individual inspector's experience and knowledge will determine the quality of the inspection.

Tuesday, May 22, 2007

My Hero

This is my hero Makoto Nagano. He is a ninja warrior from Japan. A fisherman, he trains daily to keep his strength and be the greatest ninja warrior ever. Some day I want to be just like him. As an alternative, if I could learn a few phrases of Japanese and eat more sushi, I'd probably be ok.


Wednesday, February 7, 2007

Best File Sharing Web Site

My friend "E," has a pulse on the absolute best of 'Net around. I haven't figured out how he manages to stay on top of such an always changing environment, but he just does. I've been to BestSharing, ShareIt, etc. but they are all cheesey and slow. Plus if you want to email the file to someone, the URL is 5 miles long and they recipient has to jump through hoops.



No longer, try www.senduit.com This web site literally has 2 pages. One page for the uploads (the home page) and a second page for downloads. The url is super short. Drawbacks? I could only see one: 100 MB file limit. So what, right? Split the file and be happy.



Here's a screenshot of the upload:



Here's the download URL:

And here's actual download:

Notice how simple it all is. You can see their business model based on Ad Impressions.



Way to go senduit.com and great find E.

Test Class for your Marketing Cloud Trigger

When using the Salesforce Marketing Cloud Connector to enable Marketing Cloud access from Sales and Service Clouds, folks often want to perf...