<< Previous | Home

Salesforce week 18

This week marked my 4th month at Salesforce! That's so crazy. 4 months already - where did the time go? Joining Salesforce was a big decision and since I joined the time has flown by. It has taken some time but I'm starting to feel at home in my new role in CSG here at Salesforce. As always change is hard and a change of job is no different. Well it's probably hard for me to say that as this is the first "real" job I've had as I've been self employed / co-owner of the company I've worked at for the last 20 some years. But it has been a bit hard but as I said before I'm starting to feel at home in the #SalesforceOhana.

It's been a bit of a change from being at a tiny ISV working with what I see now as legacy technologies to working at one of the largest software companies in the World. And an innovative cloud company at that. I'm really enjoying the change of perspective and change of technologies and I can feel that I'm making a difference with what I do and what I bring to the customer I'm at. Great.

On the "normal job front" the week was busy as most weeks are. Two consecutive days in Stockholm where I flew there and back both days to get enough points to make SAS Gold again. It seemed really stupid at the time and the Wednesday 6.15am flight was really stupid but it will all be worth it in the end March when I make Gold again. The FastTrack and the Lounge access is really nice and especially when it looks like the project will be on until the end of the year.

I almost finished the Lighting Components I've been developing for the customer we are totally changing the look and feel of Salesforce. I cannot wait to show it off on this blog when it's all done and I've anonymised it :) Project wise we are also getting ready to launch the next sprint on April 3rd where we are bringing an entire new business line onto Salesforce. That launch will contain 3 major components that I either developed or played I major part in which is pretty neat!

What did I learn

  • It takes time to settle in
  • Although it's spring in Copenhagen doesn't mean that's the case in Stockholm
  • Tons and tons about Lightning Components

Status after this week

Trailhead points: 80150
Trailhead badges: 82
Certifications: 5 (Salesforce Certified Administrator, Salesforce Certified Platform App Builder, Salesforce Certified Advanced Administrator, Salesforce Certified Sales Cloud Consultant, Salesforce Certified Service Cloud Consultant)

Tags :

Using preformatted HTML in a Salesforce Lightning Component

Had to output preformatted HTML richtext from a richtext field in a Lighting Component the other day. Looking through the documentation I found the ui:outputRichText component but it didn't really work the way it's mentioned in the documentation. Instead of the body of the tag containing the HTML the HTML had to be in the value-attribute as shown below.

<ui:outputRichText value="{!v.data.Contact.Bio}" class="bio" />
The "bio" CSS class I added is to actually apply the formatting I need. Although the HTML contains the HTML tags the CSS on the Lighting Pages stripped the UL and LI formatting I needed so I had to manually add that back. The CSS I applied is below.
.THIS .bio {
    margin-left: 15px;
}
.THIS .bio ul ol {
    margin-top: 10px;
    margin-bottom: 10px;
}
.THIS .bio p {
    margin-top: 10px;
    margin-bottom: 5px;
}
.THIS .bio li {
    display: list-item;
    list-style-type: disc;
}

Salesforce Lightning Design System (SLDS) Activity Component and z-index

For the Lightning Components I'm developing for a customer I'm using the activity timeline component to show a chronologic timeline of "stuff". However when I added the markup to my Lightning Component and ran it inside Salesforce the vertical bars were missing. What to do? Crack open the Chrome Developer Tools and inspect - but hey! Then the bars were there... Close Developer Tools and the bars were gone again. Hmmm... Seems to be a viewport height issues. But then again not...

After quite a lot of tinkering I figured out that the issue was actually caused by a z-index issue of the layer showing the bar. I had to add the below CSS to my styling. Please note that I'm using the "event" sprites and coloring. But the most important thing to pay attention to here is the z-index of the :before psudo class for the slds-timeline__media classes and the slds-media__figure.

.THIS .slds-media__figure {
	z-index: 2;
}
.THIS .slds-timeline__media--event:before {
    background-color: #a9a9a9;
    z-index: 1;
}
.THIS .slds-timeline__media--event:before {
    background-color: #ff6600;
    z-index: 1;
}
YMMV...

Salesforce Lightning Components and image dependencies

I am developing some Salesforce Lightning components at the moment as while Lightning Components are great they have a major drawback in my mind. Some background first... Salesforce Lightning is our "new" component based UI based on HTML / Javascript and components are automatically mobile ready and responsive. A Lightning Component is not a single "thing" but rather a folder with stuff that is a number of files named using a predefined format. The component name is the name of the folder - e.g. MyComponent. The actual markup goes in the component file called MyComponent.cmp. Besides the markup there is the client side controller (MyComponentController.js), CSS styling (MyComponent.css) and that's basically it. There are few more potential files but they are not important for this post. All is well described on the web. What's not included in the component is graphics that may be used by the component.

The way graphics are added to components a either by using the sprites supplied with the Salesforce Lightning Design System (SLDS), by using custom graphics or you can use the classic icons which are supplied by Salesforce. The latter are really not ideal as do not look nice as they look old and the colors cannot be easily changed. The issue with using custom graphics or the SLDS sprites is that the resources are kept in Salesforce as static resources which is great for performance as they are automatically loaded through our CDN but they are outside the Lightning component. So now a component is no longer self contained but has dependencies to other metadata elements. To make it even worse these dependencies cannot be declared for the component that the normal dependency detection doesn'work eg. changesets will not detect the dependency. Not good...

To solve this I've started to use base64 encoded images as they can easily be used in img-tags and may be embedded in either markup or in JavaScript. An img-tag can use base64 instead of an image reference as below. This solves the above issue as images are now fully contained in the component code or markup so no external dependencies are required. An easy solution to a complicated problem.

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAL" />
This

On Mac (and Linux probably) getting an image as a base64 encoded image for easily done using the base64 command and I normally cut lines to 80 characters as the developer console doesn't handle looooooong lines well. Combining with sed can add the quotes and pluses to make it easier to get it into Javascript. A little tweaking if required but it is faster.

base64 -b 80 -i ./picture1.png
base64 -i Downloads/gold_star.png -b 80 | sed -e 's/^\(.*\)$/"\1"\+/'

Salesforce week 17

Boy a busy week and the following as well. So much that I didn't have time to write this post. Will try and sum up for week 18.

What did I learn

  • Blogging takes time...

Status after this week

Trailhead points: 80150
Trailhead badges: 82
Certifications: 5 (Salesforce Certified Administrator, Salesforce Certified Platform App Builder, Salesforce Certified Advanced Administrator, Salesforce Certified Sales Cloud Consultant, Salesforce Certified Service Cloud Consultant)

Tags :

Salesforce week 16

Week 16 brought my first full week budgeted at my customer and I was asked if I wanted to stay on for the rest of the year. I said "yes please!" and take it both as a pat on back for work well done as well a encouragement that I'm definitely heading in the right direction. The night I spent in Stockholm was spent on Trailhead as I really want to make Ranger. Ranger is awarded when one has earned 50k points and 100 badges. I'm well beyond the 50k points but need 20 more badges. I'm making a push to make Ranger in March. It may be a bit ambitious but it's a goal none the less. Let's see if I make it. Beyond that I want to start tackling additional certifications primarily Platform Developer 1 and Platform Developer 2.

Work wise the week was spent mostly prototyping two new UI's for the customer - one for search and one for the contact record. I'll share more next week I think. The contact layout is a drastic simplification of the built in UI which - let's face it - IMHO is way to complex for the average user. Both the UI's are based on Salesforce Lightning. One I mocked up inside Salesforce using Salesforce DX (loving it!!!) and the other one using Lightning Design System and Heroku. We had a session with the customer on Friday and they really liked it. Very happy.

Salesforce DX continues to be a joy to work with. The CLI makes it so much easier to work and develop using the tools I like instead of the built in web developer console. And even combining the two. A key workflow is now to write code, push to scratch org, do a couple of tweaks using point and click, pull the source back down and then "git commit". So Nice.

Now it's time to get cracking!

What did I learn

  • Salesforce DX still rulez the day!
  • 20 badges to go before I make Ranger
  • Kafka looks nice - already have a pet project lined up to try it out

Status after this week

Trailhead points: 79100
Trailhead badges: 80
Certifications: 5 (Salesforce Certified Administrator, Salesforce Certified Platform App Builder, Salesforce Certified Advanced Administrator, Salesforce Certified Sales Cloud Consultant, Salesforce Certified Service Cloud Consultant)

Tags :

Salesforce week 15

A week with two days of travel although not going to Stockholm for a change. This weeks trip brought me to Amsterdam and our Regional Kickoff for the EMEA North region. First day was breakout sessions for the various divisions and then drinks and dinner. Day 2 was the main regional kickoff and after a mindfulness session and group massage we got started. All good fun, good information an a nice place to meet new people and colleagues. Only drawback was the hallways of the venue where the noice levels from hallway conversations really made you tired. All in all two great days with the extended team. Wednesday, Thursday and Friday was either in the home office or at the office in Hellerup. All in all a normal week - but then again not quite...

Tuesday night I joined a conference call heading home from the airport. The conference call was on the pilot program on Salesforce DX which is the new Salesforce Developer Experience. If you are working with Salesforce and haven't heard or seen anything about Salesforce DX you have work to do. Start at the before mentioned link and then see this session (Deep Dive Into The New Salesforce Development Experience (DX) Architecture) from Dreamforce 2016 showing what it is all about.

It. Is. So. Cool!

Let me give you a bit of backstory as to why. As you may know I didn't join Salesforce until 3,5 months ago (15 November 2016) so I'm still new to the platform. What baffled me and was about to make me pull my hair out is the fact that the *org* is the source of truth for everything. Data and code. This means that all development and customizations are done in the org using the tools provided by Salesforce. The tools are okay but the workflow is just so old school compared to moderns toolchains and workflows. Salesforce DX turns all this on its head. With Salesforce DX development is source-first, the main way you interact with Salesforce is through the CLI (command line interface) which makes scriptning easy and orgs is something you create and throw away very easily (using scratch orgs). It. Is. So. Cool.

I've now had the pleasure to work with Salesforce DX for two days and it is just plain awesome. I'm already using it for some prototyping for the customer I'm working for and it's just plain awesome. I can easily control my code using git and create different prototypes in branches and easily deploy to scratch orgs for testing. So nice. I'll definitely be blogging more about Salesforce DX when I get an official "go ahead". It's a public pilot but want to air on the side of caution. Say tuned.

What did I learn

  • Salesforce DX rulez the day!
  • The gym at Hilton in Amsterdam can make most gyms jealous
  • Lightning grows more potent by the day
  • Did I mention Salesforce DX rulez the day?!

Status after this week

Trailhead points: 74000
Trailhead badges: 75
Certifications: 5 (Salesforce Certified Administrator, Salesforce Certified Platform App Builder, Salesforce Certified Advanced Administrator, Salesforce Certified Sales Cloud Consultant, Salesforce Certified Service Cloud Consultant)

Tags :

Salesforce week 14

Short week as I had Thursday and Friday off - or PTO as we call vacation. But a great week. Monday and Tuesday I spent on-site in Stockholm and Monday night I finally got my act together and took the final certification exam of my onboarding and I'm very happy to report that I passed. Yay!! I now have passed all the 5 certifications I needed to pass. #happyDays

It was also my first week of being billable at the customer which was great. Wednesday was spent in the home office. All good stuff!

A thing I find myself doing more of is explaining the Salesforce fundamentals to people internally. Whether the job role is Success Manager, Account Executive, Project Manager or so on we (us at Salesforce) basically all have a requirement to pass at least the test for Salesforce Certified Administrator. This of course yields loads of questions from non-technical people as they simply do not have the same basic understanding of core fundamentals and a skeleton to hang their knowledge on if you will. So I'm using my ability to explain some of these things in very simple terms and answer questions. This is something I really like and I find that I learn more about the platform by having to explain it to people.

What did I learn

  • If you doubt whether you can pass an exam go for it!
  • You learn a lot by teaching a platform
  • There is some joy to actually being billable

Status after this week

Trailhead points: 71150
Trailhead badges: 72
Certifications: 5 (Salesforce Certified Administrator, Salesforce Certified Platform App Builder, Salesforce Certified Advanced Administrator, Salesforce Certified Sales Cloud Consultant, Salesforce Certified Service Cloud Consultant)

Tags :