Monday, September 28, 2015

Microsoft Ignite 2015 Round Up / Summary

I've summarised some of the most interesting/important parts of my TechEd 2015 NZ notes in this post.

The top five sessions for the conference based on session feedback:

  1. The Secret to Telling Awesome Stories from Microsoft's Chief Storyteller
  2. The Microsoft DevOps Vision
  3. Aligning Architecture to Organisation
  4. Public Speaking Skills for Quiet People
  5. Torment Your Colleagues with the 'Roslyn' .NET Compiler Platform

My top sessions, in no particular order

Great Artists Steal: Build better software by applying patterns and ideas from different languages

Orion Edwards - @borland

  • Ruby
  • C# Scoping lambda for locks and transactions, building up and then committing.
  • Consider the parameter naming. Try and form a phrase. C# named parameters.
  • Swift
  • if let - unwarps null references in if/else.
  • C# - Create Optional generic type. Implicitly converts from null. Unwrap to take lamba to handle existing and null cases. Not great for input parameters.
  • Also, HtmlEncoded, Atomic, Tainted, Either
  • C++ - Zero Cost Abstraction
  • Can be used with struct in C# as well.
  • System.DateTime is an example. Useful for multiple data types in combination. When unit of measure is important.
  • If you can get a Haskell program to compile, it is probably free of bugs.
  • Grand Central Dispatch - from Apple
  • Queues are lightweight threads. You "dispatch" lambda functions to them.
  • Like Dispatcher in C#
  • Serial Queue. Jobs won't run in parallel.
  • Go
  • goroutines and channels
  • Channel with send and receive.

Torment Your Colleagues with "Roslyn" .NET Compiler Platform

Ivan Towlson

"The Duke Nukem Forever of compilers"
  • C# and Visual Basic compilers
  • Syntax trees for code
  • Semantic model
  • Visual Studio editor integration.
  • Roslyn Overview on dotnet github.
  • Syntax Visualizer - browse the entire tree.

The Secret to Telling Awesome Stories from Microsoft's Chief Storyteller

The Internet of Hackable Things

Kirk Jackson @kirkj - Felix Shi @comradpara

Project Premonition: Mosquito seeking drones and Microsoft Azure

So You Want to Present at Ignite

Chris Jackson

  • 60 seconds to get their attention. Then got to land the point.
  • How to be effective as an influencer.
  • Preparing your submission - earning the right to be heard.
  • Build your reputation. Humans make the decision on who gets the cut. Who is the person, are they credible.
  • Be authenticate.
  • Volunteer to speak. Start a blog if writing is your thing.
  • Less likely to pick the total unknown.
  • Understand the goal of the track. What is the story they are trying to tell.
  • Sell yourself to the track lead.
  • Preparing for your talk.
  • Presentation design and presentation aids.
  • What do the track owners looks for.
  • What is on the screen should only be there to pull people back on track.
  • Keep the number of words on the slide to a minimum.
  • Max 5 words on 5 lines.
  • Make it real with demos.
  • You already know the material. You don't remember what it is like to not know.
  • The first 60 seconds. If it sounds awkward and unrehearsed with it's unrehearsed.
  • Practice the first 60 seconds the most.
  • What is shipping and what are the trends.
  • Inspire, don't teach. Take an action at the end of 60 minutes. One to three things tops.
  • Tell Stories. List of facts do little to inspire us.
  • How do I make this real.
  • Pillars and organization. How do you support the primary objective of the talk. Is it driving the outcome you want.
  • Stick your landing. Try to avoid ending on Q&A
  • Get speaker training. Someone who will tell you stuff you need to hear.

The Cinematic Cloud - Pixar Studios

Developing Cross Platform Mobile Apps with XAML and MVVM

See Also:

Thursday, September 24, 2015

Salesforce Winter `16 breaking SOAP Partner API changes

Just encountered this connecting to a Winter `16 Sandbox Org (v35.0) via the SOAP Partner API from Summer `15 (v34.0).

I've cross posted to the Salesforce StackExchange and raised support case 12544039

System.InvalidOperationException: There is an error in XML document (1, 2239646). ---> System.InvalidOperationException: Instance validation error: 'urn:SearchLayoutFieldsDisplayed' is not a valid value for soapType.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2427_soapType(String s)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2428_Field(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2458_DescribeSObjectResult(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2692_describeSObjectsResponse()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer193.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at FuseIT.G4S.SalesforceConnector.SalesforcePartner.SforceService.describeSObjects(String[] sObjectType)

I suspect the problem is the new soapType's that were added in API version 35.0 for Winter `16.

As they didn't exist in v34.0 of the API, if they come back in the SOAP response the .NET XML Serialization won't know how to handle them.

The following API call against v34.0 of the Partner API shows the problem.



<soapenv:Envelope xmlns:soapenv="" xmlns:urn="">

Response Snippet

<soapenv:Envelope xmlns:soapenv="" xmlns="" xmlns:xsd="" xmlns:xsi="">
            <type>API REQUESTS</type>
               <label>Fields Displayed</label>
               <!-- ^^^ PROBLEM IS HERE for v34.0 - this isn't a valid soapType until v35.0 -->
            <label>Search Layout</label>
            <labelPlural>Search Layouts</labelPlural>
            <urlDetail xsi:nil="true"/>
            <urlEdit xsi:nil="true"/>
            <urlNew xsi:nil="true"/>

Ideally Salesforce shouldn't be sending elements from the v35.0 back to the v34.0 API. It's likely that SearchLayoutField, SearchLayoutButtonsDisplayed, SearchLayoutButton and RecordTypesSupported would cause similar issues with existing integrations.

Bonus namespace alterations

Be aware that some elements have changed namespace between v34.0 and v35.0. E.g. In v34.0 the soapType enumerations location and address were in the urn namespace (""). In v35.0 They are now in the tns namespace (xmlns:tns=""). Make sure the API URL you are calling matches up with the WSDL version the classes were generated from.

Tuesday, September 22, 2015

Dreamforce 2015 Round-up / Summary

This was my second year attending Salesforce's annual Dreamforce conference in San Francisco. My first was last year.

Again, I focused mostly on the developer side of things which are around the Moscone West building - Home of the Dev Zone

Dev Zone


Using Oculus Rift and Virtual Reality to Visualize Data on Salesforce

Introducing the Welkin Suite IDE for Salesforce

A Salesforce IDE built upon Visual Studio Code.

Custom Folder Structure - The ability to create sub folders within the project to organize components looks to be really useful.

Plus support for code comments.

Apex Enterprise Patterns: Building Strong Foundations

Patterns for:

  • Separation of Concerns + Factory Pattern
  • Service Layer
  • Domain Layer
  • Selector Layer

Parker Harris's True to the Core: What's Next for Our Core Products

  • It will be possible to disable Person Accounts in the future.

Get Ready for a New Kind of Customer Success with Marc Benioff & Special Guests

175,000+ conference attendees. 25,000 of which are developers.

Demo of Thunder, the IoT cloud integrated with the Azure Event Hub for Office 365

Build Reliable Asynchronous Code with Queueable Apex

Apex Interactive Debugger

Fireside Chat with Satya Nadella and Jessi Hempel

A nice perk of becoming a Salesforce MVP this year was reserved setting access to some of the keynotes. In my case I got front row seating to the Satya Nadella keynote. Right in line behind Tony Prophet, who some of you may remember from last years main keynote.

Salesforce Developer Keynote

Introduction To Apex Asynchronous Callout Framework, aka, Continuation

Apex Testing Tips and Tricks - Community Campfire

Generically Call External Classes from Managed Packages

Using Type.forName to get the Type for a classname configured in a custom setting that the managed package can instantiate using .newInstance().

Understanding the Salesforce Architecture: How We Do the Magic We Do

Meet the Developers

Marc Benioff & Parker Harris Q&A

Sessions to catch up on


<table style="width:194px;"><tr><td align="center" style="height:194px;background:url( no-repeat left"><a href=""><img src="" width="160" height="160" style="margin:1px 0 0 4px;"></a></td></tr><tr><td style="text-align:center;font-family:arial,sans-serif;font-size:11px"><a href="" style="color:#4D4D4D;font-weight:bold;text-decoration:none;">Dreamboat - Celebrity Infinity</a></td></tr></table>

I'd sum up the Dreamboat as:

"among the most impressive accommodation you'll hardly even see"

Dreamforce is a pretty full on conference. You can be booked up from breakfast to as late as you want with meetings, sessions, keynotes, and after hours functions. This usually means waking up sometime around 6 am, maybe grabbing a quick breakfast, and then disembarking to the first meeting of the day. Then staggering back in to get some sleep before doing it all again tomorrow (assuming you make it back before midnight).

As far as accommodation goes, I'd have to rate the Dreamboat as among the most impressive I've seen. With multiple swimming pools, a gym, theater, basket ball court, and casino (not operational) all on board, there was no shortage of things to do. If only you can find the time. I don't think I made it to the Constellation Lounge during daylight hours and was surprised to see what it looked like during daylight hours.

Plus the views. Open the curtains before leaving for the morning to catch the sun coming up behind the bay bridge. Then see the silhouette of the Golden Gate bridge as the sun sets. Then the city skyline in the evenings.

Salesforce StackExchange breakfast

It was great to catch up with fellow users of the site prior to the start of the conference. A good way to put faces to names before things get going at the conference.

Random learning's

  • It's hard to take a photo of yourself getting a ride on a Pedicab without getting an ass in the picture. Do have small notes for payment.
  • Don't tweet a picture of Yoshiki unless you want to draw the attention of his fans.
  • You're going to need another bag to bring everything back home.
  • Do stop by the Admin zone for the professional headshots. Try to do it early in the week before the lack of sleep starts to catch up with you.
  • Get your twitter handle and avatar on your badge. I spend all year interacting with people via twitter, then struggle to identify them in real life.
  • AT&T do a 1.5GB nano sim card with 1.5GB of data for $45 USD. Combined with the conference WiFi, it was easily enough to get through and stay connected.
  • You can't give session feedback on sessions held in the DevZone theaters as you can't scan into them like you can with the breakout rooms.
  • If you're a developer, ignore the advice to leave your laptop behind. How are you going to complete the Mini Hacks or try anything out as you go if you don't have your tools on hand?
    My Surface Pro 3 was really useful. I could knock out the mini hacks, take down more complicated notes, do on the spot demos, ... Only catch for me was needing to change my date time settings to PST to connect to the WiFi. Go figure.
  • If you can time it right, drop ship things to the FedEx office at 726 Market St. It is only a quick walk from the conference and you can get a "Hold at FedEx location" when shipping.
  • Got a spare 30 minutes. Make a quick excursion to the Expo in Moscone North.
  • Visit the construction site for the Salesforce tower.
  • To use the pre-purchased BART return ticket you need to print out the receipt to present at the airport information booth. They won't accept a digital version on a screen.

UCSF Benioff Hospital Tour

The hospital has autonomous TUG robots helping with transport tasks around the hospital. I'm surprised these weren't featured in the IoT side of the conference.

See also:

Tuesday, September 8, 2015

Dreamforce 2015 is coming. Are you prepared?

Something has always bothered me a bit about conferences. The reveal of large new roadmap features mid-conference. A day of sessions has already gone by, and now there is a keynote telling you about a great new feature that you want to learn more about before the end of the conference. What to do? Ditch all the other sessions that you have otherwise already carefully selected to start learning about a new feature from scratch?

The recent Salesforce global Lightning Experience event has bypassed that by moving the big announcement to a few weeks out before the conference starts. There is some lead time for delegates to adjust session schedules and hit the conference with some knowledge of what they are getting themselves into.

With Dreamforce 2015 just around the corner, it's a great time to get ahead and get yourself some of that preparation knowledge for the changes that are going to occur to the core user interface.

The Developer Trail - Lightning Experience brings together 5 modules that cover areas of interest to a developer.

With the Lightning experience being so new and not available in all orgs yet (not GA), the modules mostly use multi-choice questions in the evaluation rather than inspecting your connected developer edition org. You will however cover some important topics, such as:

You also get to learn the importance of having good admins and not letting the developers do the rollout to a large org. Confetti canons for Everyone!

Once the developer trail is completed, some of the modules have cross over with other trials. Such as the Lightning Experience Basics, which is the starting point for some of the trails. So you would already have a good start on Admin Trail - Migrating to Lightning Experience.

See Also:

Friday, August 28, 2015

Dreamforce 2015 Session picks

Here are some of my current picks for Dreamforce 2015 sessions. They are mostly development focused. There could probably be more Lightning Experience sessions in the mix.

Likely I've made the same mistake as last year and overbooked myself with sessions, of which the list below is only a sampling. There will no doubt be lots of last minute chopping and changing. I'll probably triage based on if I can later catch the sessions recorded content. As Peter Knolle suggests, favoring sessions that occur in Moscone West will keep you mostly around the Developer Zone for technical sessions and save on trying to run from location to location.

Tuesday, September 15

Wednesday, September 16

Thursday, September 17

Friday, September 18

  • 12:30 PM Meet the Developers
    Because: Questions!
    As I've mentioned before, this is a great session to ask any burning questions of Salesforce developers.
  • 2:00 - 3:00 Marc Benioff & Parker Harris Q&A
    Because: That's a wrap
    Depending on the timing for getting to the airport for my flight home, it could be a fun way to end the conference.

Thursday, August 13, 2015

Salesforce Apex gotchas for a C# developer

There are a number of areas in Salesforce Apex that can routinely catch a developer coming from a .NET language out. Worse still, when constantly switching between Apex and C# the similarities in syntax can lead to confusion about what is applicable in the current language.

This post will be a continual work in progress. I'll come back to it as things come up.

Feature .NET C# Salesforce Apex
String Delimiter " - double quote ' - single quote
String Comparrison Case sensitive by default. String.Equals can take a StringComparison.OrdinalIgnoreCase InvariantCultureIgnoreCase or to ignore case Using == will be case insensitive. Use the String.equals or String.equalsIgnoreCase methods.
For each loop syntax foreach(X x in y) { } for(X x : y) { }
Case sensitivity Case sensitive Case insensitive. The variable map can easily conflict with the system type Map.
Collections List<string> or string[] are interchangeable in Apex.
Appending to the end of a list The List<T>.add(index, T) method doesn't work if the list is empty. See Should List<Object>.add(index, listElement) work if the index is at the upper bound?
params Apex doesn't have the concept of params like C# does. So if you try and pass a single string to something like String.format() you get the error
Variable does not exist: String
. Instead you need to explicitly put the formattingArguments into a List<string> or string[]

Source: Stuck on a “Variable does not exist: String” error

Properties Either automatic properties or explicit members required. Apex properties have an implicit member with the same name as the property.
Properties provide storage for values directly. You do not need to create supporting members for storing values.
Read-only and write-only automatic properties
Integers int or System.Int32 integer
Booleans bool or Boolean Boolean
Nullable Types Need to explicitly use Nullable<T> or ? notation to make primitive types nullable. All variables are implicitly nullable. In addition to the usual suspects like Integer, Boolean, Decimal, Double, Long, String, Time, Date, DateTime, it also includes Boolean. So you may be passed a Boolean parameter that is neither true or false.
Collections Dictionary Map
Exceptions Classes extending Exception must have a name ending in 'Exception'
Use this.setMessage(message); to set message rather that constructor.
switch statement switch Not available, use multiple if/else if/else statements. Add "Switch" or "Case" Statement to Apex
Generics Yes Internal Types only
Winter 13 Release Notes
Parameterized Interfaces No Longer Supported
Parameterized interfaces are not supported in Apex saved using API version 26.0 and later.
Access Modifiers public "Public access is the most permissive access level. There are no restrictions on accessing public members" global "This means the method or variable can be used by any Apex code that has access to the class, not just the Apex code in the same application."
public - "This means the method or variable can be used by any Apex in this application or namespace."
In Apex, the public access modifier is not the same as it is in Java. This was done to discourage joining applications, to keep the code for each application separate. In Apex, if you want to make something public like it is in Java, you need to use the global access modifier.

See also:

Friday, August 7, 2015

Salesforce UNKNOWN_EXCEPTION, portal account owner must have a role: []

After being dropped into an existing Salesforce Org to make changes the first thing I like to do is run the existing test cases. It gives me a rough lay of the land and a feel for the health of Org.

Is it just scrapping by the 75% threshold? Or, worse still, are current test cases already failing in production?
These are things that are going to make change set deployments from a sandbox difficult. More so when combined with any further changes I want to make.

One such recent Org started with a large number of test cases failing with the message:

UNKNOWN_EXCEPTION, portal account owner must have a role: []

This was occurring when the test methods were attempting to insert a User with the "Customer Community Login User" profile. Oddly this wasn't occurring in the sandbox.

The test cases in question were inserting an Account, Contact, and User record that were all related to each other. From the error message, the Salesforce User that inserts that Account needs to have a role assigned. For some reason the Sandbox user I was provided had the Role set, and the production user didn't.

Setting my current users Role in production fixed that particular issue.

For good measure, I updated the test cases with the following to make the resolution more apparent.

// UNKNOWN_EXCEPTION, portal account owner must have a role: []
System.assertNotEquals(null, UserInfo.getUserRoleId(), 'The current user with Id: ' + UserInfo.getUserId() + 
             ' Name: ' + UserInfo.getUserName() + ' needs a Role assigned to test Portal/Community users');

Onward to fix the the remaining existing failures...