Friday, August 26, 2011

Salesforce.com: Change Set unable to deploy Master-detail objects

The detail object just keeps failing with 
"Cannot set ControlledByParent on a CustomObject without a MasterDetail relationship field"
However, the same object deploys just fine with Eclipse (presumably Ant directly too).  So, I guess this has to be chalked up to Change Set?

Saw similar report here (see comment by griffin).

Monday, August 15, 2011

SFDC dashboard redirect: to dash or not

If you want your SFDC dashboard to click through to something else other than the underlying report, an alternative URL can be specified.  If the URL is another report in SFDC, the preferred way is to have /reportId as the URL.  Using a server name free URL makes refresh to sandbox work without additional effort.

Sometimes you may simply user reportId as the URL.  This will work when viewing the dashboard, because that's basically a relative path.  However you need to remember that this WILL BREAK DOWN if the dashboard gets snapshot on the Home page.  That's because the URL for Home is servername/home/home.jsp, which renders the relative path to an incorrect location.  So, I'd almost use the dash version (absolute path) at all times to avoid this subtle issue.


Thursday, August 11, 2011

Understanding the OpportunityHistory object

From Force.com documentation, you'll learn that every record there is a change to one of the following fields on Opportunity: Amount, StageName, CloseDate, Probability, or ForecastCategory. However it's not obvious to see how a stage change (or any change) is recorded (expressed in records).  I eventually figured out that two time fields on the OpportunityHistory records are the key:

CreatedDate

The time when this change happened

SystemModStamp

The time this record becomes history (the time when a new OpportunityHistory record following this one is generated)

So for instance, if you need to figure out what the previous stage was for a particular stage, find the OpportunityHistory record with the stage name first. From that record use the CreatedDate and locate a record with the exact value in its SystemModStamp. The stage name in that record would be the previous stage.

What's on the built-in Opportunity History report looks like values derived from the OpportunityHistory object instead of values coming directly from it.

Tuesday, August 9, 2011

Bluetooth blues

Bluetooth is a technology meant for short distance (except for hacking of course). I learned that fact when trying to retrofit my desktop with BT based wireless K/M. Since the desktop isn't BT-enabled, I picked up a USB dongle out of the thousands floating out there. With a Dell PU705 Travel BT Mouse and a Dell GM952 BT keyboard, I was in business in short order. However I quickly discovered that if I plugged in the dongle in one of the back USB ports, the mouse became pretty jerky in motion. If it's in a front USB port, it worked OK. Not wanting to occupy any of the two precious USB ports on the front long term, I tried remedying it by swapping out the old battery in the mouse, hoping it's the weak battery causing reception issues. No improvement.

Because of the size of my desk and the arrangement of the stuff on it, back ports are about 1 foot farther away to the mouse than the front ones. And one foot might as well be another continent in the world of Bluetooth! I guess the dongle's power isn't that strong, and the mouse is really intended to pair with a laptop that's usually an elbow away. Combined they're powerless (literally!) facing the 5 feet of chasm between them.

Frustrated but refused to extend my poor wrist just to make it work, I decided to bring the port closer. After locating a powered USB hub (Belkin) in the basement, I connected and put it next to the monitor, then plugged in the dongle. That's about 1.5 feet away from the mouse. Man what a difference that made - the mouse movement is now smooth like butter! Does the power of the strength decrease proportional to the square of distance? I can't remember my college physics anymore, but apparently it's just REALLY significant.

For anyone out there struggling with a shaky Bluetooth connection: getting closer can be the easiest solution!