<< February 2017 | Home | April 2017 >>

Salesforce week 19

Another busy week where all focus was on getting our customer ready for the launch of their next release on 3 April. Again I've been a bit optimistic about my estimates but all it good and the customer is happy. They just signed an extension to our contract so we will probably be here until the end of the year. Great testament to the value we are providing. Next week I'm going to be two days in Stockholm and 3 days the following week in the week of the release. After that we have a short sprint of 2 weeks to complete a custom search component - again entirely in Lightning. Cool. Cool. Cool.

On the personal front I felt great joy when talking to my former employer. The last thing I did before I left them in November was deliver a project integrating the OnTime Group Calendar for Microsoft with the Danish national system for sending SMS reminders called NemSMS. Intravision is getting ready to sell the solution to the second customer which is great by itself but the potential customer has been in contact with the existing customer to gather experience with the system and their only comments were: "simple to use" and "just works". Great!! I have to make a mental note to do a write up of the solution.

What did I learn

  • Another busy week
  • Writing your work V2MOM makes you want to do it on a personal front but it may ruin my procrastination

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 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 :