<< Previous | Home

Salesforce week 20-23

Wow I'm behind on these... I'll have to sum up the last 4 weeks and get better at doing these.

At the end of March I made Trailhead Ranger! I'm very happy that the ambitious goal of making Trailhead Ranger by the end of March was accomplished. On the Wednesday night in the bar of my second home (Radisson Hotel in Stockholm) I earned the last badges to bring me over the line. Great! I hurried over to my V2MOM to complete that measure on my FY18 V2MOM. Check! Next up is getting started on my Certified Developer I certification.

I also received emails about certification renewal. Oh well...

Last week was of course the terrorist attack in Stockholm :( The truck hit the building just 100m or so from one of the Salesforce offices. So sad and frustrating why people cannot just agree to disagree....

What else? I've been head down in work finishing of the first release at my customer I have been a part of and working on new existing stuff. I already had one big component deployed to production and on next Tuesday my next big contribution is being rolled into production and I'm really excited about it. Both are Salesforce Lightning components and they are pretty slick. Really shows what can be done. Once these are out I promise to record a video and post it. I also have loads of experiences and new stuff about Lightning development to share here on this blog.

On a more sad note my on-boarding buddy Rasmus got a new role inside Salesforce and will be switching teams. I'm really excited for him but I'm sad to see him leave our team and my current project. He's really a nice guy and a super competent architect. Glad he's still part of the Ohana though.

What did I learn

  • Lightning, Lightning, Lightning
  • More Lightning
  • Funky quirks about picklists from SOQL now that all picklists contains both an alias and a value
  • APEX performs really really well

Status after this week

Trailhead points: 85325
Trailhead badges: 100
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 :

Case in point - why we have API limits

This week the customer I'm working for went live with the next phase of their Salesforce rollout. The phase includes a Contact Sychronization feature where Salesforce contact objects are synchronized to users mobile devices using their Google Account. The contacts are flagged either in bulk or specifically using a Lightning Component on the Contact Page, has Salesforce1 integration to allow users to perform and manage sync on the go as well as a delegation feature to allow other users to manage their synchronization settings on their behalf. Think managing partners etc...

Anyway we went live on Monday morning and Tuesday morning the news hit. We had hit the API limit. The API limit is a hard upper limit on the number of API calls any customer may do towards Salesforce from external applications. There are a number of factors deciding the actual limit such as user count, license types etc. but in this case the limit was 500.000 calls in a 24 hour rolling period. We were at 555.593! Not good and and it was only 9am. Hmmm what could be wrong?

After looking into the matter we found out that the culprit was - you guessed it - the Contact Sync. The actual sync component that does the reads from Salesforce and writes to the Google Accounts of the Contact Sync feature was set to run every 10 seconds and not every 15 minutes as planned. At this rate the customer would hit an estimated 20.000.000 (20 million) API calls in a 24 hour window. Not good. A simple reconfiguration and we were back on track.

Talking to the friendly people at Salesforce Support we were even given an extra allowance of API calls for the day and the customer were back in business.

But case in point - this is exactly why there are (API) limits. If you hit the limits you are probably doing something you shouldn't. Well hopefully that's why you hit the limit.

Tags :

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 :