Saturday, July 28, 2012

Installing Bazaar for PC

Bazaar for PC is the easiest way to side-load apps onto your windows phone if you don't have a homebrew marketplace installed on your phone. I had a really painful time getting this up and running so for the benefit of myself in future and possibly others, I thought I would list my set of most reliable steps to getting Bazaar for PC working.

Install steps

 1. Most people will have done this, but if you haven't - download and install the Zune software http://www.microsoft.com/windowsphone/en-us/apps/zune-software.aspx

2. Download Windows Phone SDK 7.1 ISO
http://go.microsoft.com/fwlink/?LinkID=226694

3. Use your ISO mounting tool to mount the ISO (If you don't have a tool already, Virtual Clone Drive is free and easy to use)
http://static.slysoft.com/SetupVirtualCloneDrive.exe

4. Run setup.exe in the root folder of the ISO

5. Download and install the Windows Phone SDK 7.1.1 Update
http://www.microsoft.com/en-us/download/details.aspx?id=29233

6. Download and install Bazaar for PC
http://wp-bazaar.com/Bazaar/Bazaar/Releases/BazaarForPC.application

Usage steps


1. Start up the Zune software and connect your phone

2. Start up B4PC and enjoy

Yes that's right, for best results you should have the Zune software running at the same time as B4PC.

Why this approach?


Bazaar for PC has some dependencies such as Dot Net Framework 4.0 Full, and the install will fail if your PC doesn't have these installed. You can waste a lot of time hunting down and installing these dependencies individually, but they are all already packaged in the Windows Phone SDK 7.1 (which is also a Bazaar dependency), so you can just install this and you should have all the Bazaar dependencies.

Unfortunately there are many ways that the Windows Phone SDK 7.1 install can fail, so I strongly recommend downloading the ISO rather than the web bootstrap, otherwise if you have repeated installation attempts you will be spending a lot of time waiting for the SDK files to download.

Probably the first thing you would want to install is a homebrew marketplace so you can immediately cut the cord and install apps directly on your phone. However the marketplace apps aren't available on Bazaar for PC for some reason! This means you will have to install the marketplace apps via XapHandler. Check this app out on Bazaar for PC for instructions.

Troubleshooting the Windows Phone SDK 7.1 install

 MS instructions say to look at your %temp%\dd_install_vm_xcor2_100.txt file. You can find out where your temp folder is by opening Windows Explorer, clicking in the address bar, typing %temp% and hitting Enter.


Reading this txt file I found that the install decided to extract some files to an external drive, but was then was unable to access the files during the install. So I had to disconnect the external drive temporarily.

Friday, July 13, 2012

SQL Server date format for Salesforce upload

convert(nvarchar,datefield,126)

produces yyyy-mm-ddThh:mm:ss.mmmZ

e.g. 2008-10-02T10:52:47.513Z

(Must also set date format and time zone in Data Loader)

Friday, May 25, 2012

Formatting a date in Visualforce


%LT;apex:outputText value="{0,date,dd-MMM-yy}"%GT;
 
%LT; apex:param value="{!inv.Invoice_Date_Sent__c}"/ %GT;
  %LT;/apex:outputText
%GT;

 


I forgot it once, I'll forget it again...

Tuesday, November 29, 2011

Subclipse overlay icons

Lifted from http://stackoverflow.com/questions/3917925/what-do-the-arrow-icons-in-subclipse-mean/3920248#3920248 because something this valuable should be an article - not just an answer.

When working with the Subversion repository, remote changes (those on the repository) are incoming changes (remote → local), while local changes are outgoing changes (local → remote).

In views that compare the local and remote copies, incoming changes are denoted with a blue, left-facing arrow, while outgoing changes are denoted with a gray, right-facing arrow. These arrows may be decorated to indicate more specific operations.

The Package Explorer view, on the other hand, indicates a file's status with a different set of icons representing its local state. These icons are the ones most commonly seen, so let's start with them:

Ignored File - A file ignored by version control. You can control what resources will be ignored by going to Window → Preferences → Team → Ignored Resources.
Unversioned File - A file not under version control. These are typically new files that you have not committed to the repository yet.
New File - A versioned file that needs to be added to the remote repository. These are typically files you have either renamed, or moved to a different directory.
Deleted File - A deleted folder. These are folders that you have deleted locally without yet committing the changes to the repository. Note that files are usually removed from the view when they're deleted locally, so they are normally not seen with this icon.
Synchronized File - A file with no local changes.
Local Changes - A file with local, uncommitted changes.
Locked File - A locked file.
Conflicted File - A conflicted file. These are typically files that had a commit/update conflict that you marked to resolve later.
Tree Conflicted File - A file that has a tree conflict. These are typically files that have local changes, but have since been moved, removed, or renamed in the repository since the last local copy update.
External File - A file that is external to the project. Linked external files cannot be committed to the repository.
Switched File - A file that has been switched. These are files which belongs to a different working copy than their local parent directory.

In a synchronization view (e.g. via Synchronize with Repository or Commit), as previously described, there are icons which indicate which direction a change is occurring in as well as additional information about that change. These are described below:

Outgoing
Commit Changes - A file whose contents have been modified and will be committed to the repository.
Commit Addition - A file that will be newly added to the repository. This may coincide with a file removal in cases where a file is moved or renamed..
Commit Removal - A file that will be removed from the repository. This may coincide with a file addition in cases where a file is moved or renamed.
Property Change - A file with property changes, in the Commit dialog. On the Synchronize tab, property changes are currently reflected as a normal file modification (Commit Changes).

Incoming
Remote Changes - A file that has content changes committed to the repository that will be applied to the local copy.
Pull Addition - A new file that will be added to the local copy from the repository. Like the outgoing file addition, this may be the result of a move or rename.
Pull Removal - A file that will be removed from the local copy because it has been removed from the repository. Like the outgoing file removal, this may be the result of a move or rename.

Conflict
Conflicting Versions - A file that has been changed in both the local copy and repository independently, causing a need for conflict resolution. Fixing this condition involves opening up the conflict view or forcibly overwriting changes locally or remotely.
Synchronization Tree Conflict - A file that has a tree conflict. This can occur when there are new changes to a file on one end (either local or remote), and the file is moved, removed, or renamed on the other.

Finally, the Synchronize with Repository option opens the Synchronize tab (Synchronize Tab) with the following buttons:

Synchronize Source - Synchronizes the local copy with the currently selected repository when clicked. Selecting from the drop-down allows switching between different remote code bases.
Show Incoming - Shows only incoming changes (remote → local).
Show Outgoing - Shows only outgoing changes (local → remote).
Show Incoming and Outgoing - Shows both incoming and outgoing changes (remote ↔ local).
Show Conflicts - Shows conflicting changes.
Update Incoming - Updates all local resources with incoming changes after prompt.
Commit Outgoing - Brings up the commit dialog to commit all outgoing changes.
Show Changesets - Breaks up the change lists by revisions.

There are a few other views which weren't covered that have additional icons, but this should hopefully be a good start. Let me know if there is anything important missing, or any of these descriptions seem to differ from your actual experience.

Salesforce.com activity - parent field is Subject

I needed to be able to restrict the criteria for a Salesforce.com workflow rule so that it was only triggered if an activity belonging to a particular custom object was changed.

To identify the object type I wanted to check the first 3 characters in the GUI field that's equivalent to the API WhatId.

Finding out from googleland which field I should use for this was surprisingly fruitless. Wrong choices:

  • Opportunity/AccountId
  • Contact/LeadId

Through trial and error it turns out that Subject was the right field! (!?!?Subject!?!?)

So my simple filter looks like "Subject starts with a99"

Wednesday, November 23, 2011

Finding my way around the Force.com Eclipse IDE

I find that it's easy to accidentally close tabs and views in Eclipse, or send them to Fast View. The bottom right panel in particular seems to have a high mistake rate for me.

Views are easy to bring back if they were accidentally closed:

Force.com views - e.g. Window: Show View: Problems
Standard Eclipse views used by the Force.com perspective - e.g. Window: Show View: Other: Progress

If the views aren't visible after using Show View then they have probably ended up in Fast View.


Fast view is in the bottom left corner. In the image shown there are two icons: the Fast View menu and the Progress view.

To rescue the Progress view, click it and it will be displayed on top of the Project Explorer. Then move the view back to its rightful place.

To rescue other views, select the view you want from the Fast View menu and move it.

Don't select views in the Fast View menu that are already in the right place - they will disappear into Fast View.

Wednesday, March 23, 2011

Salesforce.com and validation rules

Salesforce.com supports validation rules that are evaluated when DML is performed on a record. These rules can be defined using formulae (which means you can get far more sophisticated than "required field") and the error messages can be presented in user-friendly language.

This is a far better experience than specifying required="true" for each apex:inputField, which can be too simplistic to meet business rules and will return field labels that may not necessarily be user-friendly (e.g. "Date Customer Last Contacted for Product Category A" is not suitable for customers completing a satisfaction survey).

Unfortunately these validation rules are not evaluated simultaneously - they are worked through one by one until there is an error or no rules are left. This means that for a page with 20 validation rules, the end user may have to fix 'n' click 20 times before they can save the page contents.

The only way I'm aware of at present to perform simultaneous evaluation AND present user-friendly error messages is to codify the validation rules in the controller class - bleagh!

Any better suggestions?