Pages

Tuesday, November 6, 2012

Removing the Magic, Applying the Science, Keeping the Force

I'm very excited and happy to announce that I have joined Ami Assayag (@amiassayag) and his company, CRM Science  (www.crmscience.com), as a Salesforce.com developer.



Be sure to check out www.crmscience.com and follow us on Twitter @CRMScience for the latest and greatest.

If you're in the Philadelphia area, be sure to check out the PhillyForce Salesforce User's Group (http://www.meetup.com/PhillyForce).  It's a great community with a great number of area experts that offers monthly meetups and fairly regular co-working sessions during the week.  (@PhillyForce)



Wednesday, September 19, 2012

Dreamforce '12 - Red Hot Day 2

Today boils down into Keynotes and the Gala.


The keynote featured success stories from many clients, using many of the new in '12 sister sites.  The School of Rock is an example of this and they demonstrated how their school functions with Do.com.  Two announcements made for Do.com were an Android app and a now open API for developer use.

Then on came MC Hammer, performing with his crew "Too Legit to Quit" and "Can't Touch This."

Next came a quick segment that seemed fairly recycled from last year, touting the evolution of computing and its shift from on-premise servers and hardware to the cloud.  These changes are fostering the "Social Revolution" in which Salesforce.com is proud to be part of.

The rest of the keynote were success stories from GE, Rossignol, Charles Schwab, Activision, Yelp, Commonwealth Bank, Virgin America, and Facebook.  Marc Benioff's vision of General Electrics future was interesting and in short form think of engines with APIs, dumping data into Salesforce for analysis.  I saw this on a smaller scale in the Dev Zone yesterday with the Fitbit.  My highschool Cisco networking professor, Mr. Thomas, predicted this over a decade  ago when he said everything will talk to everything and collect information about itself.  Data is king.

The Fireside Chat with Marc Benioff and Sir Richard Branson started off interesting and then seemed to snowball off-topic.  I enjoyed hearing about Branson's start and how he became who he is, but the conversation quickly turned to politics and my ears went numb; tuning in and out.  Benioff inquired Branson's stance on the war on drugs.  A cheer erupted as Branson announced the war on drugs was a failed effort and he would like to see countries "decriminalize" drugs (note, not legalize) and treat their use the same as you would treat alcoholism.

The Gala this evening was very enjoyable.  7-8 blocks away from the Moscone Center, City Hall was set up to entertain this year's almost 90,000 Dreamforce attendees.  Starving from a long day, we were first greeted with popcorn.  Popcorn turned into tents with gazpacho, BLTs, shrimp coctails and tons of beer and wine.  Hiking deeper into the lawn area, more food tents contained quite an array of food including fish and chips, nachos, meatballs, pizza, and more.

Red Hot Chili Peppers came on a little after 8:15 and played their greatest hits, new and old (Can't Stop, By The Way, Dani California, Californications, Under the Bridge, Snow and others with Give It Away as the encore.








Tuesday, September 18, 2012

Dreamforce '12 - Day 1

I'm back in San Francisco again this year for Dreamforce '12.  After an (adventurous || adrenaline packed || terrifying || downright good time) weekend of climbing in Yosemite with CRM Science's Ami Assayag, I came to this city in a mentally prepared state to soak in as much as I can.  The older, wiser, and more experienced me thought I knew what to expect, but it seems #df12 has grown just as much as I have over the past year.

The number of attendees, venues, and sessions have all expanded.    Somehow, I managed to spend all of my day in the Moscone West building. 

Session #1: Unleash the Force.com User Interface with Skuid
Skoodat's Skuid seems like a great tool that would save a ton of time in developing custom page layouts or even stand-alone pages. Its drag and drop visual page editor reminded me of Frontpage or Dreamweaver as the code for the page is created for you behind the scenes. Within a few minutes, the presenters created a new multi-paned and tabbed Contact view as well as a custom list page. With a handful of clicks, they were able to add additional actions to each row of their data set. I'd love to see something like this become a general release feature

Session #2:  The 10-Year Evolution of Developers and Salesforce.com
This was another session that took place in the Developer Theater tucked behind the Dev Zone. David Claiborne of The Claiborne Company did a great job of showing how far Salesforce.com has come along over the last decade+. Apex and Visualforce haven't always been key components to the platform, neither have sandboxes or custom objects. This session made me realize that I began working with many of the modern enhancements of Salesforce.com as they were being released.

For a list of those features and to vote for your 3 favorite features visit: here

Session #3: Apex Design Patterns
Not coming from a developer background, this was one of the best sessions of the day for me. Not only were best practices discussed, but common development patterns applied to Apex were demonstrated. I can see future posts in my near future as I explore the 6 patterns presented.

  1. Singleton
  2. Strategy
  3. sObject Decorater
  4. Façade
  5. Composite
  6. Bulk State Transition


My other sessions of the day included:
Session #4:  JavaScript Patterns and Practices from the Salesforce Experts
Session #5:  Introduction to Heroku
Session #6:  Workbench:  The API Swiss Army Knife


The Expo (Moscone North) and Campground (between North and south) opened today at 2 and held a Welcoming Reception at 6.  Great food and drinks spread out among the vendors.  

Follow me on Twitter:  @kirkevonphilly
Join the PhillyForce Salesforce.com User Group:  http://philly.force.com/ 

Thursday, August 30, 2012

Day Changer: Chrome Extension - Force.com LOGINS

Today's Day Changer is a Chrome Extension named "Force.com LOGINS."

Download it here.

Why is it useful?  If you've got multiple Salesforce.com credentials to keep track of, this extension allows you to keep them organized.  Once you've entered them, it only takes two clicks to log into any instance in either a new tab or a new window.  Working on several different projects through out the day, I'm frequently in and out of production and sandbox orgs.  With this extension, I'm typing my credentials a lot less frequently.


Before you install it, take a look at the author's security note to decide if this extension will work for you in your working environment.  If not, there are plenty of non-Salesforce specific credential managers out there.

++++++++++++++++++++++++++++
Security Notice      (2012/3/7)
++++++++++++++++++++++++++++
This extension throws Force.com login username and password via POST when logging in with new tab, and via GET when logging in with new window.
Throwing information via GET means there will be URL containing username and password shown in the browser history.

For those of you who do not want your username and password shown in your browser history, please do not use 'window' button to login with new window.

Please also be aware that if anybody has access to your chrome browser, he/she can look into localStorage where all your force.com credentials are stored in.
Your credentials are not encrypted since anybody can look at the source code of the extension and somehow decrypt it.
++++++++++++++++++++++++++++


Wednesday, August 22, 2012

Day Changer: Dexpot Virtual Desktops for Windows

Day Changers are those tools you stumble upon that make an impact on your day to day Salesforcing. Today's Day Changer is one that helps me maximize the use of my laptop screen.

When I was with my old company, I fully embraced the power of multiple monitors. When I started, I had a 15" CRT beige box. When I left, I had a triple-headed monster. 21" widescreen monitor in portrait mode on the left for coding, 21" widescreen center monitor, and a 19" square for email/reference.

Anyway, now that I'm on my own, I don't always have the luxury of multiple monitors. I work off of a laptop and at best I get to work at my desk with an additional 21" lcd. Most of the time, I'm working off of my laptop's 13.3" screen.

Ouch.

Granted you can get by, but it's hardly efficient. Shortcuts like ALT+Tab are useful, toggling windows and keeping my hands on my keyboard, but I need more.

I'm a big fan of the virtual desktops found in many of the linux flavor. A quick CTRL + Alt + left, right, up, or down and I'm on another desktop with its windows exactly where I left them.

However, try as I might, I've yet to find equivalents for all of the tools I use on a day to day basis. But what if virtual desktops existed for Windows?

That's where Dexpot comes into play. A quick download, install, and a few key key assignments later I was good to go. The tool is quite flexible and offers several additional plugins like Dexgrid and Dexcube for additional eye candy.

You can configure additional desktops if needed, but I easily get by with 4 in a 2x2 grid. My top-left desktop is usually the Force.com IDE/Eclipse. Top-right is a Chrome window with multiple tabs (all within the same SF instance). Bottom-left is usually the Developer Console or a Debug Log window for testing. Bottom-right is my leftover desktop - maybe another Chrome window, Evernote, Notepad++, whatever I need.

I can keep everything logically organized on these additional virtual screens and without taking my hands off the keyboard, I flip over to another screen and quickly switch back. Adding an additional key and using CTRL+ALT+Shift and an arrow key, I can move the active window over to another virtual desktop.

If you do have multiple monitors, you can utilize them as well. Or not, by turning disabling Dexpot for those displays.

Bonus Tip #1: Windows key + arrow left or right to resize and snap a window.

Bonus Tip #2: There are shortcomings of the above shortcut key. For instance, monitor orientation is not taken into consideration. Snap a window to a portrait mode monitor and you end up with a long thin column of a window. Not too useful. That's where GridMove (http://jgpaiva.dcmembers.com/gridmove.html) comes into play. You can create custom zones and assign keyboard shortcuts to snap windows into each. For example, on my 19" square, I broke it up into 2 rows; the top half dedicated to Outlook and the bottom equally split between Evernote and Notepad++.

Friday, June 1, 2012

Using Change Sets

A question came to me this morning from someone who had certain components built out in a a sandbox and needed them to be replicated in production. The components in this scenarios were page layouts; something easy enough to rebuild manually, but if you have dozens of fields, either of these methods would be faster.

  1. Eclipse
  2. Change Sets

They both require a few additional steps, but both prevent you from having to reproduce your work. Since we are dealing with page layouts, the first thing you need to make sure of is that all the fields referenced in the page layout exist within your production instance. You'll definitely receive error messages upon trying to deploy a layout to an object that is missing fields.

Using Change Sets

The Change Sets method will be easier for non-developers that don't know their way around Eclipse. This method will allow you to build Outbound Change Sets bu adding and removing components, and then uploading them to any allowed Deployment Connection. Let's start there by allowing establishing a Deployment Connection between your sandbox and your production instance which will allow you to upload Outbound Change Sets to Production for deployement.
  1. First, within your production instance, click on your name at the top of the page, and then click on "Setup" On the left-hand side, under "App Setup," expand "Deploy" and click on "Deployment Connections"
  2. Find the name of your sandbox and click on the "Edit" link next to it
  3. Check off the box that says "Allow Inbound Changes" and then click on the "Save" button.
The next thing to do is to create an Outbound Change Set within your sandbox. For this scenario, the change set will include a page layout that I want to deploy within my production instance as well as a new field that I added to the object within the sandbox. One change set, two components, one deployment. Nice!
  1. Within your sandbox, click on your name at the top of the page again and then click on the "Setup" link
  2. On the left-hand side, navigate to "App Setup" --> "Deploy" and then click on "Outbound Change Sets"
  3. Click on the "New" button to create a new Outbound Change Set
  4. Provide a "Name" and "Description" for your change set.
  5. Click on the "Save" button.
  6. Within the "Change Set Components" section, click on the "Add" button.
  7. First, let's add the new field. Change the "Component Type" dropdown to "Custom Field"
  8. Next, find and select any fields that you also need to deploy that are not currently found in production.
  9. Click on the "Add to Change Set" button at the top of the page. Here's a quick tip -- make sure that you use the "Add To Change Set" button after you select something. Changing the component letter, page, or "Component Type" will clear any previous selections.
  10. Now it is time to do the same for the page layout. Change the "Component Type" to "Page Layout, find and select your new layout, and then click on "Add To Change Set" again.
  11. Your change set should have two components in it now.
  12. To push your Outbound Change Set to the Production instance for deployment, click on the "Upload" button.
  13. Choose your Production instance and then click on "Upload"

Within a few minutes you should receive an email, letting you know that your Change Set was uploaded to the production instance. Keep in mind that you don't always have to push from a sandbox to production. You can go from sandbox to sandbox or even production to sandbox.
Once you do receive that email, it is time to deploy it.
  1. Within your sandbox, click on your name at the top of the page again and then click on the "Setup" link
  2. On the left-hand side, navigate to "App Setup" --> "Deploy" and then this time click on "Inbound Change Sets"
  3. Click on your change set. Here you will be able to see information about the change set, including its components, any details, and its deployment history. You also have two options; "Validate" and "Deploy."
  4. Clicking on "Validate" goes through all of the actions required to deploy the change set without actually deploying it. This is always a safer bet as you can learn which components will be new, overwritten, or deleted. Sometimes you learn things from a validation that you didn't expect and can save yourself from making mistakes.
  5. "Deploy" first validates and if all is well will deploy your change set. Keep in mind that if you've added new layouts, they won't be assigned to a recordtype yet, so you'll have to do that manually. If you added fields, permissions won't be set up on that field as they would be if you were to manually create the field. The same goes for picklists options and their recordtype preferences.

Thursday, May 31, 2012

Server Monitoring - Disk Space Batch File

Weeks ago we began down a road, experimenting with the idea that you could monitor servers with Salesforce.  I did mislead you; Salesforce isn't doing the monitoring, but will be responsible for creating notifications (through workflow) and give additional metrics for future systems reporting.

We've already created an object called "Alerts" to place information into (records that could cause sys admins night sweats and tremors).  That object has two fields, basically who (the node) triggered the alert and what (the conditions) the alert is for.

The next step is to create and schedule a batch. The batch below will take two parameters - the drive letter that you want to monitor and the low disk space threshold in MBs (i.e., "Disk_Space_Alert.bat C 20480" would monitor the C:\ and create an alert when the amount of disk space was 20480MBs/20GBs or less)
@ECHO OFF
setlocal

REM - This issues the DIR command on the disk letter provided, pipes it
REM - into FINDSTR, looks for the line where "free" is located, and places that
REM - line into a temp file
REM - Then it converts that line into tokens and assigns the number of free bytes
REM - to the FREE_BYTES variable
dir %1: 2>&1 | findstr free > temp

for /f "tokens=3,4*" %%f in ( temp ) do (
     set FREE_BYTES=%%f
)

REM - This removes commas and decimal points from FREE_BYTES

set FREE_BYTES=%FREE_BYTES:.=%
set FREE_BYTES=%FREE_BYTES:,=%

REM - The following line takes the number of free bytes and uses Powershell
REM - to calculate the number of MBs and assigned as a string variable
REM - This was done due to batch files numbers being limited to 32-bits of precision


FOR /F %%B IN ('powershell %FREE_BYTES%/1024/1024') DO (
    SET FREE_M_BYTES=%%B
)

REM - Next the decimals are removed and assigned to an integer variable

FOR /F "tokens=1* delims=,." %%B IN ("%FREE_M_BYTES%") DO (
    SET /A FREE_M_BYTES_INT = %%B
)

REM - Here we assign the threshold limit parameter to a variable

set /A LIMIT=%2

REM - Next, if the number of free MBs is less or equal to the limit
REM - a CSV is created. First the headers, then the alert fields
REM - After the file is created, process.bat is called to initiate the insert
REM - into Salesforce. Don't forget to install Data Loader, change your path
REM - and see my next post about the config file


IF %FREE_M_BYTES_INT% LEQ %LIMIT% (
    echo RESOURCE, DETAILS > alert.csv
    echo %COMPUTERNAME%, Low Space on %1 - %FREE_M_BYTES_INT% MB remaining >> alert.csv
    C:Program Files (x86)salesforce.comData Loaderbinprocess.bat ../conf Disk_Space_Alert
)

So in a nutshell:
  1. Create the batch file
  2. Schedule the batch file
  3. When scheduling, you'll need to specify the disk letter and the MB limit (i.e., "Disk_Space_Alert.bat C 20480")
  4. The program will launch, check the amount of disk space on the specified drive
  5. The batch will then convert bytes to MBs and compare it to the limit specified
  6. If the limit is met or exceeded, a CSV is created and formatted with information about the issue
  7. Finally, the batch calls another batch file that initiates a Data Loader insert
In the next post, I'll discuss using the SF Data Loader from the command line and how my config file is set up.