My First Lightning Web Component

Recently I had the much overdue experience of writing my first Lightning Web Component for my day job. While I’ve gone through some Trailhead modules and built a couple on my own for demos, there’s something special about being able to deliver a component that other people will end up seeing and using. While I can’t share the specifics of my company’s processes, I wanted to share some thoughts and feelings on my experiences as well as some tips as to how you can start writing your own!

Starting Out

I’ve been developing in Apex for over 5 years now, and did some Java before that. I think it’s true what they say that “JavaScript is to Java as carpet is to car”. There’s definitely a learning curve there, even coming from Aura development, which has a touch of some JavaScript functionality but primarily uses JSON with some light JS mixed in.

As with any new type of coding, I think it’s always helpful to start with some sort of design followed by pseudocode. For the design, a co-worker of mine had already come up with what the final result should look like, so I just had to figure out how to break it down into individual components.

Similar to the approach I normally take to writing Apex, I start by writing pseudocode and then generally just put everything into one method, or in this case one component. My component involved 1 screen that needed to have 3 different sections, of which only 1 would be expanded and the other 2 collapsed at any one time. Since there would be 3 separate sections within the 1 large page, that told me I’d need 3 child components and 1 parent component.

Starting Out


Salesforce has invested heavily in VS code and with good reason, it’s a very powerful software development tool. Salesforce has developed many custom extensions to assist your development with the tool as well. If you haven’t already, check out this Trailhead module to get started!

While I knew that I’d need to start calling Apex eventually to bring in data, I wanted to get a working component first with just some hard coded dummy data. I also knew that I’d need to be able to call some sort of event for the child components to talk to the parent components to figure out which components should be expanded or collapsed. CSS is also critical here to make sure that components and their parts are in the right spot and the right color.

While I can go for long periods of time writing Apex before syncing it to my org, it’s harder with UI development since minor tweaks are often frequent to be able to check events and CSS attributes. While you can play around in the Chrome Developer console to edit certain attributes, I personally like playing around with the different SLDS classes before I start creating my own CSS.

Salesforce to the rescue once again, using the newly announced LWC Local Development! It was pretty easy to set up and automatically updated immediately without me having to wait 10-20s to push to my org to view each change. I highly recommend this for making quick UI changes and checking event propagation. I moved away from this once I started working with Apex, since my local computer wouldn’t have access to my org’s data, but up until that point, it massively cut down on my development time.

Local Dev


I’d had some experience dealing with events in Aura, creating custom Lightning Events and then firing them from the child components via aura:registerEvent and then listening for it on the parent component via aura:handleEvent. On LWC however, event propagation works differently and depending on what you’re trying to do, there are several different approaches. They primarily involve creating custom events and custom event handlers whose names need to match the name of the event (i.e. if you create a custom event called notify, you’ll need a parameter for onnotify similar to how you’d have onclick or onchange. I found this documentation on events and this sample code base tremendously helpful! In general, the Sample Gallery has a lot of great examples whose code you can use and customize for your own needs! LWC also uses “kabob case”, stylized-using-dashes, to reference child components, even when your child component’s name uses camelCase.

Child component (sectionOneComponent) sending custom event called “section one next clicked”:

Events 1

Parent component calling an action on the “section one next clicked” event that was fired from sectionOneComponent:

Events 2

Component Parts

Once I figured out the event propagation, I needed to actually populate my components with various sub parts. Similar to Aura, this is where Base Components came in to give me an existing card, combo-box (picklist), buttons, and allowed me to lay things out in an organized manner using the layout and layout item components. Using the “Open in Playground” functionality from the Component library gave me another way to play around with different combinations before having to deploy it to my org.


Once I had the layouts more or less in place, I started deploying to my org and connecting to Apex. By utilizing decorators and events to respond when users changed values from my hard-coded dummy data, I had confidence that once I wired up the Apex, I would have a very short turn-around time to get the real data.

Once again, I went back to the Sample Gallery and documentation for some examples. While I decided to keep everything in a single Apex class for my series of components, knowing that I could add additional Apex controllers to my single LWC gave me peace of mind if I wanted to separate functionality. I had to modify my events a little bit to send data from one child component, up to the parent, and then back down to the other child component, but other than that it was relatively straightforward! I also found out that you can create a custom structure that you can assign to the detail attribute in the event to send multiple parameters to your parent components at the same time. Also ran into some issues with camelCase vs kabob-case again, but I’m guessing that will get better with experience.

Child Component One JS:

Apex 1Apex 2

Parent component JS:

Apex 3Apex 4

Parent component HTML:

Apex 5

Child Component Two JS:

Apex 6


While I still definitely have a lot more to learn about JavaScript and Lightning Web Component development, I was excited that I was able to turn these components around in just a few days! All of my HTML and JS files across my components only have 40-50 lines of code each. I still have a bunch of SLDS and other CSS changes to add before this is ready for production but I’m excited to build off of this and am looking forward to developing more LWC in the future. If you’re interested in learning more about how to make the switch from Apex to LWC, check out my session on May 16th at Virtual Dreamin!

Dreamin’ all over the world part 2 (Bangalore)

After my trip to Uruguay earlier this year, I continued my world travels in 2017 with an extended vacation to Europe and India! I spent a total of 4 days in Bangalore and while not nearly enough time to see the surrounding area, let alone the entire country, it left me with a tremendous amount of memories!

On top of all the sights and tours I took in Bangalore, the main reason I went was to speak at the Bengaluru Salesforce Developer user group, according to Meetup, the largest Salesforce Developer group in the world. I was honored to be invited to speak there and loved the opening remarks by one of the group leaders, Abhilash Kuntar, who announced that his goal was to see 50% attendance from the WIT community in Bangalore at the Developer group. This is a tremendous goal that I think all groups should try to emulate! There is a growing and thriving WIT Community in India, thanks in part to Abhilasha Singh. I’m excited to see what’s to come!

I started off by presenting on the Tooling API and finished up presenting on how to Blaze your Trail and grow your career with Salesforce. Feel free to check out the slides.

I was able to get some authentic samosas and get some selfies with some of the great people that make up part of the Salesforce community in India.

I was also extremely touched after being presented with several gifts

One of my major takeaways though, was how passionate the people are there. In addition to some great cultural experiences from the tours I took, everyone I met was extremely welcoming and helpful. Bangalore specifically, made me feel like I was back in the Bay Area, with the enormous amount of tech talent and entrepreneurial spirit that I felt from everyone.

Being based in San Francisco, near Salesforce HQ, it is easy to forget how vast the Ohana truly is, spreading all over the world. For me, this trip was proof that it is thriving in many other places as well! For anyone looking for their next major trip, or just to get some world travel in, I would highly recommend Bangalore, and India in general. There are several events taking place there in 2018, and a great many people to follow to stay up to date about all that is happening there.

India Dreamin’, Bengaluru Calling, and Jaipur Dev Fest were the major events that took place or were planned for 2017. I’d recommend following their accounts to stay apprised of 2018 details.

Special thanks to the following people who made my stay incredible, I recommend following them all and connecting with them to learn about the Ohana in India and/or to get some travel recommendations if you are able to visit!

2017 New Years Resolutions

 I’ve never been great at keeping (or sometimes even making for that matter) New Year’s Resolutions but as you’ll see by my #1 resolution for 2017, I figured this was as good a place as any to make some! Happy New Year to everyone! And now for my resolutions:


1. Blog more 

I really dropped the ball on this one in the 2nd half of last year, I originally set out to do a blog post every 2 weeks and while I did do a couple guest posts for other blogs, I didn’t come close to that mark last year. I’m going to try to be more reasonable this year and try to do 1 blog post per month. We’ll see if I can keep it up!

2. Stay current on Trailhead

I fell way behind on this and lost the top spot on my own leaderboard! While it is ultimately all about learning rather than a competition, I want to make sure I’m staying current on the newest technology (in addition to being #1)


3. Continue learning with more certifications

2016 was an ok year for me (by my standards), certification wise. I upgraded my Advanced Developer cert to Platform Developer I and II and took the first 2 steps in my Technical Architect Journey by achieving Development Lifecycle and Deployment Designer and also the Sharing and Visibility Designer certs! I still have a long way to go though to catch up to some people!

In 2017, I’m going to focus on some of the other Architect Academy certs and also try to actually get into some of the Marketing topics! There are a bunch of Marketing Cloud and Pardot certifications and this is a great incentive for me to learn more about them!

4. Complete additional Technical Architect training

As mentioned, I made some progress in 2016 but I still have 3 more to go and 2 optional ones. I definitely have a lot of additional learning to do on Salesforce Identity and Access Management as well as how to architect Mobile Solutions!

Hoping I should have a good shot at the Data Architecture, Integration Architecture, and Community Cloud Consultant currently with some studying!

Architect Academy.jpg

5. Build my 1st production Lightning Component

I recently completed a pretty great Trailhead module on Lightning Components but I’ve yet to complete any of these in my day job. This is a little bit out of my control as it depends on the business needs but since some of my peers have been building some of these, and I have a better idea of how these work now, I’m hoping to build one (or at least help build one) myself in 2017!

6. Don’t spend so much time at the office

This is something that as a Type A perfectionist I struggle with, but I definitely want to spend some more time this year making friends and developing some hobbies. I signed up for Gordon Ramsay’s Masterclass so I’m hoping he can teach me how to cook also!

7. Volunteer more

Being in a relatively stable position career wise and financially wise, I feel like as part of the Salesforce Ohana, it’s my duty to help those who haven’t been as privileged as I have. This year I had the pleasure of helping out as the first ever male coach in the RAD Women program teaching women to code as well as helping out an admin as part of Vetforce. I’m still trying to find additional ways to help out though so if anyone has any ideas, feel free to share them!

8. GymForce

Like many people, I have a desire to get in shape without enough motivation to do so. I was having a conversation with some about trying to find a way to make “Trailhead for the gym”. I’m sure there’s an app out there for game-i-fying working out so if anyone has any good suggestions let me know!


17 is my lucky number (in case you were wondering why it’s in my Twitter handle) so here’s to a great ‘17! Feel free to share your goals and feel free to keep up the pressure on me to hold me to mine!


I just got back (i.e. took a 5 minute bus ride home) from the first ever Salesforce developer conference, TrailheaDX! Just wanted to share my thoughts and help anyone who missed it feel like they were part of the experience as well!


I wasn’t sure what to expect when I first signed up for the conference as details were a little hard to come by. I entered with an open mind and right away identified the forest, or “Trail” theme that was present (TrailheaDX get it?). There was also a pretty sweet Dev Zone setup similar to what you’d find at Dreamforce with a very “Developer” theme present! There were a bunch of great demos available including one of my favorites on IoT from Josh Birk (@joshbirk). There was also one by Christophe Coenraets (@ccoenraets) on Bot integration, the #AwesomeAdmin team on Process Builder, and some partner demos including Amazon Web Services, Slack, and Microsoft. Normally I tend to stay away from sponsor booths unless I’m interested in the swag but I actually sought some of them out to see some of the cool stuff they were demoing. There was something for every type of developer regardless of whether you focus on declarative development, programmatic development, or sit somewhere in the middle. I stuck to more of the code focused development but there were options for all.


There were some exciting pre-keynote talks with the always entertaining hosts Peter Coffee and Leah McGowan-Hare. They interviewed Salesforce customers and employees such as Mary Scotton, Samantha Ready, and Chris Duarte! Sam mentioned the new Trailhead Superbadge feature that is now available!

There was also a surprise live appearance by the Salesforce MVP parody band, Apex & The Limits (@ApexNTheLimits)! It was their first time presenting live all together and they did an amazing job. Check out the footage captured by Salesforce founders Marc Benioff and Parker Harris!

The keynote itself got the conference started with a bunch of demos including showing off some IoT demos with Thunder, MetaMind, Lightning App Builder, and Lightning Components. The Summer ‘16 release was looked at and the Winter ‘17 roadmap preview was talked about as well! Both Marc Benioff and Parker Harris made appearances as well as Alex Dayon, Shawna Wolverton, Adam Seligman, and Sarah Franklin. Marc made an announcement of a $50M incubator that Salesforce has created to support innovators in the community who want to build apps with Salesforce. There were also 130 viewing parties all over the world that took part and got to say hi to the conference via webcam!

I was fortunate enough to be asked to participate in the intro video and even made it into one of the keynote slides 🙂

Check out some more keynote details here!



Regardless of what type of developer you were, there were some sessions for you! True to the Trail theme, there were some campfire sessions to have some more intimate discussions. I happened to attend a pretty cool one on Inclusion in Tech with Mary Scotton (@rockchick322004)! Highlights from that discussion below. Unfortunately due to capacity, I wasn’t able to get into a couple of the other campfire sessions as they were first come first served and I didn’t get there early enough. I also missed out on a building bots hands-on training since they didn’t want to violate the fire codes. Understandable but I was a little disappointed about missing that one (fortunately the workshop was posted online!).

In terms of some more traditional sessions, there were a wide array of those as well! I saw several sessions on the agenda regarding Introduction to Apex and others on Advanced Process Builder for the more declarative oriented developers. Being more interested in the coding side, I attended two different sessions on the Lightning Component Framework, the first of which talked about how XML and CSS fit in and the second one discussed where JavaScript and Apex came into play. It definitely helped me understand a bit better how all the puzzle pieces fit together and was a nice refresher on some of the object oriented principles baked into the framework.

On Day 2, I attended a pretty sweet session with Christophe Coenraets (@ccoenraets) where he talked about how bots are becoming the new apps and showed off some bot integrations with Salesforce to Slack, Facebook Messenger, and the Amazon Echo. Even more amazing, you can download all the code and more as a package from this site here and recreate the demos yourself! This was probably one of my favorite sessions I’ve ever at a conference and I’m very excited to start playing around!


Force Bot


Trailhead Bot


Diving even deeper into the programmatic capabilities, a couple of engineers decided to recreate the demos using the React JS framework. Unfortunately I’m not the greatest when it comes to JavaScript so while I was able to follow along at a high level, looking at the code there in small chunks didn’t do me a ton of good. Still pretty cool to see some of the capabilities and I’m sure the JS gurus that were in attendance appreciated it!

The last session I went to was a Q&A with the Salesforce Platform team. The team answered questions from several audience members, including a few challenging ones from some of the MVPs, and did their best to convey what was coming (within the bounds of Safe Harbor/Forward Looking Statement guidance of course). They didn’t reveal a ton but did talk about how they’re looking to make changes to the deployment UI (change sets) and also add a bunch of other features. They were only able to say that it’s coming “soon” though.


Swag and Friends

Outside of the learning and keynotes at Salesforce conferences, I’m always interested in collecting swag and meeting up with friends from the community that I mostly only know through Twitter. At TrailheaDX, I was able to do both! I came away with a sweet new water bottle and pair of socks for watching a demo and earning a badge while on site, a new backpack, some study materials (including a Lightning Experience Guide, Lightning Components developer guide, and cheat sheets), and a pretty sweet Rubik cube from the CRM Science team.

In terms of friends, I also did pretty well! I got to hangout with the always fun #AwesomeAdmin team, the Developer Relations team, and Team Trailhead from Salesforce, as well as meet a few of the MVPs I had only known virtually, and even snap a few selfies with some of them! I also got to meet Abhilasha Singh who came in all the way from India! Pictured below are me with Misty Jones (@MistyRaeJones) in from Arizona, Jen Wobser in from Arkansas (@crmsalesgem), Abhilasha Singh in from India (@Sweety_abhi), Kristi Guzman in from North Carolina (@KristiForce), and in the last picture Ryan Headley in from Wisconsin (@lifewithryan), Nana Gregg in from Texas (@nanahg3), and Katie McFadden also local to San Francisco (@katiesmcfadden).

There were also a couple of pics in trail gear taken that didn’t have me in them 🙂 Feel free to check those out here!

One More Thing

It wouldn’t be a Salesforce event without a little star power, and this one was no different. We got to watch a show from Lenny Kravitz and a fireside chat with the one and only Steve Wozniak! As an Apple fanboy, I was ecstatic! The concert was pretty awesome and Woz shared some anecdotes about hanging out with Steve Jobs, pulling pranks, his love for technology over business, his thoughts on the current state of technology, some good and bad experiences with recent Apple products, and how far he thought AI would get in the future. I definitely enjoyed hearing him speak and got inspired to go buy his book.


Overall I’d say it was a very successful conference! I’m guessing for next year if Salesforce puts it on again they’ll probably want to pick a bigger location, and I’ll definitely make sure to get in line for the really popular sessions a bit earlier. I got some sweet swag, great networking, learned some more info I can take back to work to help my company, and had a fun time hanging out with people who love Salesforce like I do (#SaaL). Regardless of your flavor of development, TrailheaDX had a place for you. I hope they do put the conference on again next year and I’ll make sure to be in attendance!


Building Even More with Salesforce

Happy New Year!.  I wanted to expand a little bit on my last post and introduce a few other basic admin tools to round out the Standard and Custom objects portion of the Certified Admin exam, compromising 18% according to the rubric.  I also wanted to share my new Journey Progress page and encourage you to start your own if you haven’t already!

More on Lookups

Last time we introduced the unique concept of creating a field on an object that links that object record to another object record, such as a Contact to the Account that it corresponds to.  By connecting 2 objects together, you can create complex automations and gather additional data on parent objects when its child objects get updated.  Creating a lookup relationship creates what is called a One-To-Many relationship meaning that there will be one single parent object and potentially many child objects.  The child object record will have a single field that will be a hyperlink to the parent record and the parent object record will have what’s called a related list on the bottom of the record page that will show all of the associated child records.  

Use Master-detail lookup relationships when you want the child objects to depend on the parent objects.  For example, if you had a custom object called Jedi Knight and a related object called Lightsaber, you may want a Jedi’s lightsabers to also be deleted if the Jedi record is deleted.  You could also have a roll-up summary field to count the total lightsabers a specific Jedi owned*.  The detail object record will inherit all security and visibility from its master record.

If you had another object called Vehicle, you probably would want to assign the Vehicle a new Pilot if something happened to the original one.  A standard lookup relationship would be best here to relate the two objects but not make them dependent on each other.  This allows you to have a variety of vehicles and pilots that you can swap out as necessary.  It may be possible that better pilots could be driving multiple vehicles but chances are vehicles should only have one primary pilot.

Sometimes it’s necessary to create a many-to-many relationship, for example if I was setting up a college course signup app, I might have a custom object called Student__c that would be enrolled in multiple Course__c objects.  In turn, each course would have multiple student objects associated with it.  In order to set up a relationship such as this, we can use what is called a “Junction object”.  We could create an additional object, such as Course_Slot__c that would have a lookup field, and a One-To-Many relationship, to both the Student and Course objects and would represent one student signing up for one course.  We could then adjust our Course Slot related lists on both the Student and Course objects so we could see a student’s complete schedule and a course’s full roster by looking at their specific records.

*You can also create a one-to-one (1:1) relationship using a hack with roll-up summary fields and validation rules outlined here:

Chained Dot Notation

In the last post, we also introduced the concept of “Dot notation” where I can say Wand__c.Wizard__c and be referencing a Wand’s corresponding Wizard lookup field.  But what if I wanted to know what Hogwarts house the Wizard was in without having to click on the Wizard to find it?  If I was looking at the wizard, I could look at the Wizard__c.House__c field and that would tell me!  Wouldn’t it be pretty cool if I could ask a wand which house its wizard was in though?  Fortunately, Salesforce let’s us do this!  We just have to let Salesforce know we want to ask a wand about its related record.  Because it’s a related object though, we’ll use slightly different notation, namely “__r” instead of “__c”.  We can say Wand__c.Wizard__r.House__c to ask about the Wand’s Wizard’s House from the Wand record!


Generally you can have Salesforce figure this out for you by inserting merge fields such as in the screenshot above but it’s definitely good notation to know, and even better to know that we can do it!  You’ll most often see this in formulas, validation rules, and email templates, and as with most things, you can also do it in code.  You can also create a chain of objects up to several lookup levels deep!  As with electronics though, it can get messy, not to mention dangerous, if you go down too many levels so Salesforce has a depth limit of 5 levels in place (3 for master-detail).


Schema Builder

A good way to view all the relationships between your objects is by using the Schema Builder.  The example below shows that the Account object has a One-To-Many relationship to the Case, Opportunity, and Contact objects, Contact has a One-To-Many relationship to the Case Object, and the Lead object is not connected to the other objects via lookup.  You can also create fields from here but I generally prefer going through the UI instead.


Record Types and Page Layouts

While it is great to be able to create a great data model full of standard and custom objects and fields, it is likely that you’ll have different types of records for each object and different users are probably going to need to see different fields.  For example, you may have a bunch of different droids represented as Contacts.  Some will be protocol droids such as C-3PO, some will be astromech droids such as BB8 or R2-D2, and some will be medical droids.  All of these would be classified as contact records but are going to have very different relevant fields.  

Is there really a point in an astromech droid having a field called Languages_Spoken__c or a protocol droid having a field called Medical_Skill_Level__c?  Most likely not.  The Contact object will need to have both of these fields though.  This is where the concept of Record Types come in, so you can quickly figure out how many of each type of droid, or Contact you have.  You may also allow certain users to only be able to create certain types of new droids.

You might also have different employees that need to see different fields of the same type of record.  For example, you probably won’t want a Sith in your organization, or any one else in the Dark Side department, to know the value of Home_Planet__c on the protocol droid Contact record type but they still may need to know about its existence for reporting purposes.  You can create separate page layouts for various users and assign them to record types and user profiles so you can determine exactly which fields each type of user should see for each record.  

Note that fields are added to Page Layouts, Page Layouts are assigned to Record Types and associated with Profiles.  You can’t add fields directly to record types and you can’t restrict visibility of Page Layouts directly to users.  The combination of record types, page layouts, and field level security (more on this next time) together will dictate exactly what each user will see when viewing a specific record.  

List Views

Between objects, fields, records, and record types, there’s a lot of potential data to be viewed at once.  Fortunately, Salesforce lets us filter what records we want to see in what are called List Views.  List Views allow you not only to filter which records you see at any given time, but also which fields show up on each particular view.  Sometimes it’s useful to only see records that you own, sometimes all records for a given time period, sometimes sorted by record type, or sometimes by a filter of your choice!  You can also choose if you want the current view to be visible just to you or to your entire org as an admin.  You can also allow end users to create their own list views so they can filter however they like as well.  With Lightning Experience, you can also add cool charts to your list views for quick data analysis!

Wrap Up

A lot of info to cover but hopefully you have a better understanding of how to start building on the platform and customizing a little bit more using both the built in functionality of the standard objects and some custom objects that are built specifically to support your org.  To get a little hands on practice, feel free to check out a few of the Trailhead modules listed below and the additional resources for some more information.  After you finish the modules, feel free to add yourself to the Trailhead leaderboard!


Relevant Trailhead Modules


Certification Items to Focus On

Standard and Custom Objects from the Certified Administrator Study Guide:

  • Explain how to create, delete, and customize fields, page layouts, and list views for custom and standard objects
  • Given a scenario, determine the appropriate fields and page layouts for custom and standard objects
  • Explain how to create, delete, and customize record types for custom and standard objects
  • Given a scenario, determine the appropriate record types and business processes for custom and standard objects
  • Explain the implications of deleting fields:


Additional Resources

Object relationships:

Roll-Up Summary Fields:

Junction objects: