Lightning: A Simple Multi Select Component

 

 

As we all know Lightning is on boom now. With every release we get new feature and functionality on Lightning. Many of us are just realized how much it is important to learn lightning so now I will share some small code sample related to Lightning in upcoming using them you can get a quick start your Lightning study. i also recommend you to check my previous post to get the basic Idea.

Today I will share a simple multi select component where we will pass data between two components.

MSPL.gif

Lightning Component

Controller JS


As from code you can easily get the idea that I have used component.get and have passed the attribute value to get the selected value and add/ remove the value from list. You can find the complete code here. Play with it and let me know if you face any issue.

 

Happy programming 🙂

Advertisements

Salesforce Summer 17: Cool Seagulls in Summer

Hi everyone, we all know Salesforce release 3 updates for its system in a year.  Now Salesforce recently launched Summer 17. Summer is hot and in Rajasthan it’s very hot.  So here are few hot and exciting updates for everyone.

Summer_17_Release_Logo

  1. Use Advanced PDF to Render Visualforce Pages as PDF Files (Pilot)

Advanced PDF renders Visualforce pages as PDF files with broader support for modern HTML standards, such as CSS3, JavaScript, and HTML5. This change applies to both Lightning Experience and Salesforce Classic.

To use Advanced PDF, set renderAs=”advanced_pdf” in the tag of a Visualforce page with API version 40.0 or later. This process is similar to the existing process for rendering a Visualforce page as a standard PDF file.

PDF pages rendered with Advanced PDF are subject to the same limitations as legacy PDF pages, including the maximum page size and limited number of fetched resources. Advanced PDF pages also time out after rendering for 2 minutes, which includes asynchronous processing time.

  1. Roll Back Changes in Your Org When Remote JavaScript Methods Throw Exceptions

When a JavaScript method in an Apex class calling a remote action throws an exception, the action isn’t completed. Previously, when a method threw an exception, the action was completed.

For example, when you created an Apex class that used a remote action to add an account to your org and that method threw an exception, the account was added. Now, the account isn’t added. With this enhancement, JavaScript remoting methods that throw exceptions no longer cause changes in your org. This change applies to both Lightning Experience and Salesforce Classic.

  1. Cache Operations Supported in Visualforce Controllers

Cache operations made using the put and remove methods in the Cache Namespace are now supported in constructors and getter methods of Visualforce controllers.

  1. New Option for Parallel Testing on the isTest() Annotation

Use the @isTest(isParallel=true) annotation to indicate test classes that can be run in parallel and aren’t restricted by the default limits on the number of concurrent tests. This makes the execution of test classes more efficient, because more tests can be run in parallel.

  1. Deploy Changes Now Trigger Recompile of All Apex Code

All of an org’s Apex code is now automatically recompiled before completing a metadata deploy, a package install, or a package upgrade.

Previously, a deploy, install, or upgrade left the org with invalidated code, which sometimes caused recompilation errors when many Apex transactions occurred. This change in behavior improves performance following metadata deploys and package updates.

  1. Disable Access to Non-global Apex Controller Methods in Managed Packages (Critical Update)

This critical update corrects access controls on Apex controller methods in managed packages. When this update is enabled, only methods marked with the global access modifier are accessible by Lightning components from outside the package namespace. These access controls prevent you from using unsupported API methods that the package author didn’t intend for global access.

Prior to this update, non-global methods (that is, Apex controller methods that weren’t marked with the global access modifier) could be accessed by Lightning components outside of the package namespace.

  1. Metadata Access in Apex

If you’re an ISV creating apps that use custom metadata components, you can now access     metadata using Apex. This change applies to both Lightning Experience and Salesforce Classic.

During or after an install (or upgrade), your app can create or update metadata to let users configure your app. Use the new Metadata namespace for accessing metadata in Apex code. The Metadata namespace contains classes that represent metadata types and components as well as classes that let you retrieve or deploy metadata components in the subscriber org.

  1.   Salesforce Integrations: Taking Salesforce to the Next Level

Now you can connect Salesforce with Skype for Business , Gmail, Google Calendar and Microsoft Office 365. They are generally available in both Lightning and Salesforce classic. Nut some of them are only available in Lightning.

  1. Einstein Vision Is Now Generally Available

Sign up for Einstein Vision to receive 1,000 free predictions per calendar month. If you need more predictions, you can purchase them.

Getting an Einstein Platform account is the first step to accessing the API. Use the sign-up page to get an account. You can get an account in two ways.

  • Heroku—When you provision the Einstein Vision add-on, an Einstein Platform account is created for you.
  • Salesforce—Log in with your Salesforce credentials and create an account.

After you create an account, you download your private key file. Use this file to create an access token.

You can also try your hand on a Trailhead project to understand it better.

  1. Removed LockerService Restriction on instanceof in JavaScript

    Previously, Salesforce advised against using theinstanceof operator in JavaScript code when LockerService is activated. This restriction has been removed, except when checking arrays.

There are many more other update related to Lightning and Einstein. As I am also reading them in more details so I might make another post for them in depth. This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release.

Sign up now for a pre release org.

You can read release notes here. Let me know if I missed something here or if you want to add something then let me know in comments section.

Winter 17 is Here! A Quick Preview

Winter 17 is Here! A Quick Preview

Salesforce community is very busy these days. Dreamforce is near and everybody is preparing themselves for this mega event. As winter is here. So today I come up with 10 important feature of Winter 17

  1. Horizontal Navigation Comes to Lightning — One of the main initial features of Lightning, the collapsible side panel navigation, will be a thing of the past when Winter 17 goes live. This will be a big gain in efficiency and will ease the transition from Classic as it is similar to the Classic tabbed header. An awesome feature of the top navigation is when you hover over the tab name, you get a list of recent object records.
  2. Lightning Experience enhancements — Create Custom Apps in Lightning Experience and Navigate More Efficiently, Get Field-Level Help in Lightning Experience, Get Field-Level Help in Lightning Experience using save & New button
  3. Napili Is Now Called Customer Service (Napili) and it now supports more objects.
  4. Now you can use global search instead of Quick Find to find specific setup records, such as the Lead Source picklist or the Sales Rep profile. This feature is available in Lightning Experience only.
  5. Now you can create and manage your global picklist value sets from either user interface. No more switching back and forth to manage all of your picklists in Setup. Also Standard, multi-select picklists can be as detailed as you need them to be with a new limit of 255 characters per entry.
  6. The time window to quick-deploy your validations has expanded from 4 days to 10 days. This larger time window provides you more flexibility for scheduling your quick deployment and helps minimize the impact on your org.
  7. Build Reusable, Invocable Processes — This new feature will allow admins to create one Process and reuse it by invoking it from another Process. It’ll be available in Classic and Lightning editions.
  8. Inline Editing in List View Comes to Lightning —Lightning users will be able to hover over fields in a Listview and click to edit. This feature is in Beta and some restrictions will apply.
  1. Add the force:lightningQuickAction or force:lightningQuickActionWithoutHeader interface to a Lightning component to enable it to be used as a custom action in Lightning Experience or Salesforce1. You can use components that implement one of these interfaces as object-specific actions in both Lightning Experience and Salesforce1. You can use them as global actions only in Salesforce1.
  2. The Lightning Design System is now automatically added to your Lightning Out and Lightning Components for Visualforce apps. The Lightning Design System provides a look and feel that’s consistent with Lightning Experience.

 

Here are the 10 features which I found useful. I will keep updating this list whenever I found any useful feature in Winter 17 release notes. In the meantime you should give a read to Winter 17 notes and if found anything useful share them in comments. Cheers 🙂