- Hi, everyone, my name is Ananya,
and I'm a software engineer
on the platform Developer Tools team here at Salesforce.
Today, I'm going to help you get efficient
with your Salesforce development.
So the first thing you might notice is
that the screen doesn't look
quite exactly like Visual Studio code.
And that's because it's not.
Today we're working inside
of a brand new product called Salesforce code builder,
currently in pilot.
Code builder is a development environment
that runs in your browser.
So you get access to modern tooling
through the Salesforce extensions,
while keeping your developer console flow of going to your
org and clicking a button to open a new tab
with your workspace.
So today,
I'm going to go through my usual flow in developer console
here inside of code builder.
The first thing I always do
is make sure I'm authorized into an org.
So if you click on the
org picker down here,
it pops open a list of all the different
orgs you've previously authenticated into
And it gives you the option of authorizing a new org,
a dev hub or creating a default scratch org.
For now, I've already authenticated into an org,
which you can see by the text demo run down here.
Cool.
So now let's open up the class
that I was working on on Friday,
I have a feeling that
someone in my team may have worked on it over the weekend.
So I want to compare what I have locally
to what might exist in my org.
I can do this by hitting right click
and hitting diff file against org.
What this does is it grabs a file from your
org and pops it open on the left-hand side
and shows you what you have locally on the right side.
And I can see very clearly
that obviously, something has changed.
So let's make sure
that I have the most up to date version.
I could do that by right-clicking
and hitting retrieve the source from org.
But then I wouldn't get to show off
our super cool org browser.
So if you look at this cloud icon here,
it opens up a list of all the different metadata types
that you have available to you in your org
if you expand on one have them,
you can see all the different components associated with
that metadata type.
For now, I'm going to hit the download icon,
so that I can retrieve the latest version.
And it's letting me know
that I am going to overwrite what I have locally.
Cool.
So now that I have my up to date test class,
let's actually run this test.
I can do that by hitting this beaker icon on the left side,
and it pops open this view
that is going to show me all of the Apex tests
that I have available up here.
And you might notice it
is also showing me the Lightning Web Component tests
that I have.
Because another cool feature of code builder and VS code
is that you're able to work
with your Lightning Web Components
and Aura Components in here as well.
For now, let's go ahead
and run my test set brightness.
And while that's running,
you might notice that this text over here
also gives you the option of running the test
from directly inside of the class as well.
Awesome.
And I can see that my test is run successfully
from this green dot.
And it is showing me all the code coverage
that I need down here.
The thing is,
I'm more of a visual person.
So I would rather see exactly how much of my class
is being covered.
And I can do that
by hitting this little hamburger icon down here.
This is going to show up on the right hand side,
and it lets me know that the ones in green
are the ones that are covered by my test.
And the ones in red are the ones that
are yet to be covered,
which is great.
Okay, cool.
So now that we've run our test,
we know it's successful.
I want to get a deeper look into what exactly
is happening with our test class.
And I want to use our replay debugger to do that.
So the first thing I'll do
is set a few breakpoints on the left side here.
And now there's a few different commands you need to use
to set up the Replay Debugger.
The first thing is going to be turn on Apex Debug Log
for Replay Debugger.
You can tell
that I already have done this step
because down here here it's showing me
that I'm recording my logs until 12:43am.
Next thing you want to do
is actually get the Apex Debug Logs.
So essentially what's going on in the background is
that we've turned on logging for any events
that you're doing within your org.
So after these logs get generated in your org,
you then have to go ahead
and download them using the
get Apex Debug Log command we just ran.
And now that I have my Debug Log open,
I can hit right click
and hit launch Apex Replay Debugger.
And what this will do
is it's going to launch the native VS code debugger,
and allow me to step through all those breakpoints
that I set earlier.
And if I wanted,
I could have also launched it
using this green arrow on the
left hand side.
Cool.
So now if I hit next,
I can see I am stepping into the test method
that I set all my breakpoints inside of
and I'm getting to see exactly what's going on.
So thank you all for joining me today.
I know we went over a lot of information.
But, I hope you enjoyed your sneak peek into the new
Salesforce code builder.
And again, everything that we covered today
is currently available in Visual Studio code.
So make sure to check it out.
Thank you.