Showing posts with label Lightning Experience. Show all posts
Showing posts with label Lightning Experience. Show all posts

Friday, 16 November 2018

Can't find your object fields in Lightning?

Can't find your Fields in the Object Manager search using Lightning Experience?

Then, this is the blog post you are looking for.

What's the problem?

The problem is that, as of November 2018, the search functionality for the Object Manager in Lightning Experience only provides searches by the Label of the objects and the Label of the field.

How did I find out?

I found out about this problem a couple of weeks ago, when I was working in a project where the API Field names don't quite follow the best practices and they are very different to the Field Labels...

I'm a developer, so I'm sometimes a victim of copy-paste typos and hard-coded field names, where miss-spellings happen all the time... So I was getting compilation errors due to 'non-existing' fields in the object...

So, as I've mentioned before on this blog, I consider myself an 'Admineloper', as I do a lot of point and click combined with coding on my daily job. There I go with my #AwesomeAdmin super powers to find out what's going on...


And I spent a good couple of hours double checking that I wasn't going mad... Honestly, I started thinking I found the glitch in Salesforce that nobody had ever found before!! hahaha

Then I called for help, and my colleague Tom Blockley shared his fresh pair of eyes to confirm I wasn't going crazy, and suggesting to search by the label name, instead of the API name.

Show me with a few screenshots!

And that was the key!! I hadn't thought for a single second that searching by the API name wasn't a feature of the Object Manager search...

I thought this wasn't a big deal, since I was working with a custom object that was very specific to that org, but then I found a few examples where this also happens with standard objects.

Let's see a few examples with the D&B Company object: this is the label of the object, but its API name is DandBCompany.


If we are developing and we know the API name, it would make sense to use the term 'dandb' as the Quick Find search input. Well, this is what we get when we do that:


Note that no results are returned...

Now, this is what you get when your search term is 'D&B', which is part of the Object Label:


The same thing happens with the field names, when you search by substrings of the API name, no results are returned if the Field Label doesn't contain that substring...

Another example of field search in the same object, D&B Company:


If we are programmatically manipulating this field on this object and we know its API name is SalesTurnoverGrowthRate, but we don't know some of its details, for example, its length, then it makes sense to go to the Object Manager and look for that field to check the information we are after. This is what we get if we search by 'Turnover':


Note that no results are returned... That substring is part of the API name, but is not part of the Label, and therefore it doesn't show in the result list.

However, if you search by 'revenue', which is a substring of the Label, but not contained in the API name, the result is as follows:


Also note that the search is not case sensitive, as the search term used is 'revenue', all lower case, and the Label contains the substring 'Revenue', with a capital R.

Success Idea

There's already a Success Idea for this: this link. I've upvoted it as I think this is an important feature that Lightning Experience is missing, not only to search by API name, but also by Description... So if you also think this is an important feature, please follow the link and upvote for this idea.

Looking for a field that you know the name of is great to get information about its properties, but when you don't have much information about it, it becomes quite difficult if you can only search by the field label...


Tuesday, 20 December 2016

5 #Lightning Tips for Visualforce Devs!

Most of us Salesforce Developers have started our development in Salesforce Classic. Now that the Lightning Experience is out there, we're starting to migrate our skillset from Visualforce to Lightning.

If you're in the process of starting your journey from Visualforce to Lightning, please keep reading, as I've got 5 tips for you! I hope you find them useful.

#1 - JavaScript Understanding

When I was more involved in Java projects I used to build apps with the DOJO framework. This is a JavaScript toolkit that provides multiple elements and UI components to help with Web App development.
When I moved to Lightning, I found this skillset very useful. I kept finding similarities between the Lightning and the DOJO framework.
So my #1 recommendation when it comes to starting with #Lightning is to have some JavaScript understanding. Any of the other popular frameworks (jQuery, ...) can do to help you understand the underlying JavaScript architecture.

#2 - Embedded #Lightning Components

The Lightning Experience provides a beautiful environment, and it's a very user-friendly one. But those who have been working on Salesforce Classic for a while (as is my case) may find it difficult to adjust to the new approach; and changing the look and feel of the platform, as well as the underlying technology, all at once, may be a bit disconcerting.
That's why I'd recommend starting by embedding your first #Lightning Components inside a Visualforce page that you can hook anywhere in Salesforce Classic.


The image above is an example of a Visualforce page that embeds the NewContactDataInput Lightning component. Note the use of the  < apex:includeLightning />  tag. Also be aware that not all the Lightning events are supported in Classic, but it's a good start to create something in #Lightning within your comfort zone of Salesforce Classic and Visualforce pages. 

#3 - Read the #Lightning Documentation

A good start point to understand the new Lightning Framework is the Official Documentation, where you can find the principles of the new technology, based on the open source Aura Framework.
I also find very useful the style documentation available in the SLDS (Salesforce Lightning Design System), where you find examples of the CSS classes used in the #Lightning Experience, and you can learn how to use them for your own custom components.

#4 - Explore your Developer Tools

One of my favourite tools is the MavensMate IDE. I use it together with Sublime Text 3 and it's really easy to use. The Lightning Component Bundles are made of a number of files; I find it quite difficult to navigate through the different elements from the Salesforce Developer Console.


Luckily, the IDE groups the files in the Bundle in the same folder, making it very easy to switch from the component to the controller, as shown in the image on top of these lines.

#5 - Test is a must!

When you work with Lightning Components, you find yourself in the wonderful world of a great UI experience; this is great because you "see your work" making progress!
However, sometimes this can distruct you from your Unit Tests, which will become a nightmare at deployment phase...

Trust me, I've found myself spending a whole day adding little bits and pieces to make my component look stunning, because the SLDS is so beautiful and easy to customise that your creativity gets boosted, but you can't forget about your component's controller; your controller is still an Apex class, and it needs to be Unit Tested to make it to Production!

And that's all for now. I hope you find this post useful.
Happy coding!  

Friday, 4 September 2015

Salesforce Trailhead: Learning Lightning Development

We are just 2 weeks away from Dreamforce 2015, I'm going again this year, so I have to get up to speed with the latest features. After last week's announcement to Meet the New Salesforce you can't help but get your hands on learning the new Lightning Experience, and what better way to do it than with Trailhead? None. So that's why I encourage everyone wanting to start building Lightning components to check it out. It's also a really nice way of starting your preparation for what's to come with the new Salesforce release in Winter '16.

The Lightning Experience Developer Trail takes you through 5 modules to show you an overview of the different points of view of the new Salesforce development approach:
  • Lightning Experience Basics 
  • Lightning Experience Development 
  • Visualforce & Lightning Experience 
  • Lightning Components 
  • Lightning Design System

I consider it quite important to highlight that the Lightning Experience is not fully terminated and rolled out to the whole platform at the time of writing this post (September 2015), and even if it brings new capabilities that weren't available before, it is still "Work In Progress" and it doesn't support all the features that Salesforce Classic does at the moment.

In Salesforce's own words: "Lightning components are still in their infancy and not all the features you’re used to in Visualforce are fully supported yet."

Just be patient and let the Salesforce team do their job. We'll definitely be getting updates from them with the progress through the usual channels...

This is what you can expect from each of the Modules. As usual, you will earn some new badges and you can win up to 5800 points!


Lightning Experience Basics

Find out about what the Lightning Experience is and how it's different to Salesforce Classic. View examples of the look and feel of the new interface.

Get advice on how to decide whether the new experience is right for you.

Instructions on how to enable it in your ORG.



Lightning Experience Development

An overview of the impact of the new User Experience on the typical Developer tools, like Apex, the API, Visualforce, and others.

Recommendations on what technology you should use depending on the requirements of your application. One of the features from the Lightning Experience I'm more excited about is the fact that you don't have to worry about compatibility accross devices and browsers, it's all taken care of for you!

Guidance on what to do with Packaged applications or the Apps in the AppExchange to accommodate the new Lightning Experience.

Visualforce & Lightning Experience

You will find out the ways in which you can keep using Visualforce within the Lightning Experience.

Set up your work environment for a better development experience: code editor, page viewers and review in multiple environments.

Discover how Visualforce pages behave when running in Lightning Experience and how to share them between both experiences, as well as the styling considerations to bare in mind.

Lightning Components

This module describes what Lightning Components are and how the new Lightning Components framework differs from the Visualforce one. Prepare for a good 4 hours of exciting training with this module, because this is where you will write some actual code and connect your Trailhead to your Developer ORG to create some Lightning Components.

An overview of the different techniques available for Lightning Components is given in this module: server-side and client-side controllers, Apex and JavaScript...

Lightning Design System

This final module goes into the Design principals used in the Lightning Experience. You get introduced to the Block-Element-Modifier syntax (BEM) for styling your components.

Some explanations about the Grid System, that is a good way to understand the layout that your Lightning Components will use.

You will find out next the recommended ways of accessing your Data in Salesforce from your Lightning Components; and also how to include Avatars and Icons within your components.

The final activity of this module helps you build Record Home Page making use of several components!

And now you're all set to understand MOST of what people will be talking about at Dreamforce '15!

It was helpful for me, so I hope this is also of help for you.