Friday 17 November 2017

Lightning Component Code Review using Command Line Interface (CLI)

The Salesforce world is moving fast with Lightning. Lightning is an efficient and consistent interface to navigate through your org and the Lightning Experience takes things to another level. In order to enables us to leverage our code, ensuring at the same time that we follow the Salesforce recommended best practices, Salesforce has introduced Lightning Command Line Interface(CLI).

WHAT IS LIGHTNING CLI?


Lightning CLI is a Heroku Toolbelt plugin that lets you scan your code for general JavaScript coding issues and Lightning-specific issues. This tool is based on the ESLint project and finds the issues within the JavaScript code.  As your Lightning component mostly consists of client-side code in the form of JavaScript, it becomes pertinent to have code review checks on a periodic basis.

Lightning CLI alerts you to specific issues related to LockerService. Issues that are flagged include incorrect Lightning components code, and usage of unsupported or private JavaScript API methods. Lightning CLI installs into the Heroku Toolbelt, and is used on the command line.

HOW TO USE LIGHTNING CLI?


Step 1: Heroku Installation
Download the Heroku toolbelt on your machine from the following link:
https://toolbelt.heroku.com/

Step 2: Install Salesforce Lightning CLI
Install Lightning CLI as a Heroku Toolbelt plugin. Once this is done, update the Heroku Toolbelt to get the latest Lightning CLI rules.
heroku plugins:install salesforce-lightning-cli



Step 3: Use Salesforce Lightning CLI
  1. To display the Code Review on the command prompt in a text format, use:
    heroku lightning:lint
  2. To display the Code Review on the command prompt in a JSON format, use:
    heroku lightning:lint . -j
  3. To get the Code Review as a File in a json or text format, use:
    heroku lightning:lint .(Source Path) > report.txt

    heroku lightning:lint "D:\Lightning Component\ContactList\src\aura\campingList" > report.txt

    OR
    heroku lightning:lint "D:\Lightning Component\ContactList\src\aura\campingList" -j > report.json



ADVANTAGES

There are quite a few advantages of using the Lightning CLI:
  1. Scan the code locally on the lightning component implemented before submitting the code for reviews
  2. Check/discover the issue related to security and unused variables
  3. Enforce security and code best practices across implementation

I hope you are all set to use the Lightning CLI. In case you feel the need to reference additional knowledge material, the following links are quite helpful:


References




Written by Twinkle Panjabi, Sr. Salesforce Developer at Eternus Solutions
Read More »

Tuesday 14 November 2017

How Salesforce turned Dreamforce 2017 into myDreamforce

My Einstein, My Lightning, My Trailhead — My Salesforce



If you are a Salesforce junkie, you know Dreamforce means new product announcements, mostly a ‘new cloud’ and a plethora of new things for Salesforce enthusiasts to get their hands on. This Dreamforce, they did all of that, albeit a bit differently. Rather than just roll out a bunch of swanky features and capabilities, Salesforce went all guns blazing on ‘personalizing’ their offerings. Result- mere product offerings turned into a suite of new Salesforce experience, a ‘mySalesforce’ experience!

myTrailhead

We all have benefited tremendously by using Trailhead over the years, and now, it is all set to get exponentially bigger. Salesforce launched myTrailhead this Dreamforce, allowing organizations like yours and mine to add their own content and branding, craft their own learning path through tailored modules and so much more.

myTrailhead enables you to train your employees on company, industry or topic-specific skills, essentially empowering you to blaze your own trail. Personalized, tailored, mobile-optimized, on-demand content is added with the help of a setup guide called TrailMaker, while users have customizable profiles and can be motivated by gamified leaderboards as well. The opportunities are endless. myTrailhead comes with five new tools: Trail Checker, Trail Maker, Trail Mixer, Trail Tracker, and Trailhead Profile, and is expected to be available later in 2018.

myIoT

myIoT enables any Salesforce user to collect data at the IoT scale. Real time rules can now be fed into your sales & marketing processes and trigger actions. myIoT platform is designed to operate a self-sufficient, business ready IoT, using low-code data orchestration tool to create point-and-click automation rules governing connected IoT devices, contextual business data, and proactive automation and engagement. The IoT data generated and fed is analyzed, leading to proactive and predictive engagement, providing customer context in its truest sense.

myLightning

Lightning struck this Dreamforce again and how! In words of Shawna Wolverton, a 16-times Dreamforce veteran and the SVP of Product management at Salesforce, myLighting is “a suite of tools which will allow users to personalize and customize the Salesforce interface, for example, to reflect their own branding.” Amidst the various personalization options now available, admins can now show or hide components on the dashboard as per business requirements, build process-based UIs with Lightning Flow, all without having to write code! The Sales & Service Cloud UIs have been rebuilt and they are consistent with the UI of Marketing & Commerce UIs, for a singular, seamless Salesforce experience. myLightning is also equipped with a new theme and design system, as well as the Lightning Bolt framework.

mySalesforce

You have known it as Salesforce 1 mobile app, it is now known as mySalesforce. Essentially a custom-branded, mobile low-code development platform, mySalesforce enables custom Android and iOS apps to be built and listed on Google Play Store & App Store. mySalesforce apps are customizable for branding and theme and are built using the Lightning App Builder.

myEinstein

If you are a developer, the road to build smarter, more predictive apps that leverage your Salesforce data and solve specific business challenges just got smoothened out with myEinstein. Now everyone can leverage the limitless possibilities that Einstein offers, without necessarily having a degree in Data Science. Einstein Prediction Builder uses image recognition to solve specific use cases. Einstein Bots train models to recognize objects within images and detect information such as types and quantities of the objects. Einstein Vision uses the power of natural language processing to analyze the sentiment of text, while Einstein Language helps classify the underlying intent to understand what a customer truly wants.

Einstein: the AI for CRM

When Salesforce launched Einstein, the possibilities seemed endless. Salesforce has turned some of them into reality already, particularly around enhancing the existing Salesforce products’ capabilities. So now, Einstein benefits are extended to Sales Cloud, Marketing Cloud, Community Cloud and Commerce Cloud, enabling you to use Einstein as personal Data Scientist. Advanced AI capabilities are now fused into your apps, helping deliver a more personalized and predictive experience for all stakeholders.

Sales Cloud Einstein makes your sales reps more productive than ever before, through Einstein Lead Scoring, Einstein Opportunity Insights, Einstein Account Insights, Einstein Activity Capture and Einstein Automated Contacts.

Einstein Lead Scoring automatically analyses and prioritizes the leads most likely to close business, based on your past deals. Einstein Opportunity Insights identifies customer sentiments, involvement of competitors and overall prospect engagement within the Lightning Sales Console and helps you determine how likely to close a deal is. Einstein Account Insights help you stay on top of your customers’ news, including any and all activities such as mergers and acquisitions, enabling you to make timely decisions. Through Einstein Activity Capture, you can sync your calendar and email with Salesforce, keeping your records up to date with minimal fuss. Einstein Automated Contacts analyze emails and calendar events, identify new contacts and any Contact Role relationships, and surface suggestions for automatically adding new records to your CRM.

Marketing Cloud Einstein is designed and built to create more predictive Marketing journeys, ensuring right content at right time to right audience, through the right channel. While Einstein Recommendations help increase order values, convert web visitors into customers, and recommend the next best product, content, or offer faster for every customer on any channel, Einstein Engagement Scoring manages social interactions by automatically analyzing their tone, sentiment etc. using Einstein insights in Social Studio. Einstein Vision for Social uses Einstein Image classification, recognizes social images for logos, objects and scenes, to discover new insights for your brand, even if keywords are not mentioned. Einstein Journey Insights analyzes touchpoints across consumer journeys and helps in conversion via key insights on channel, events and communication.

Community Cloud Einstein is built to recommend the right content and conversations to community users, enabling them to discover the information that helps them be more productive every day. While Einstein Recommendations helps users identify and find relevant people and information easily, Einstein Feed Insights helps drive engagement through identification and promotion of relevant, popular content.  Certified experts can be found on the community using Einstein Experts, while Einstein Feed Search helps you get best answers to searches based on relevance and popularity.

Commerce Cloud Einstein stems from the need to make shopping a more personal and predictive affair, through product recommendations, sorting and merchandising insights. Einstein Commerce Insights uses data from products, users and order to identify best deals and products, while Einstein Product Recommendations creates unique customer experiences across channels with personalized recommendations that ultimately help boost revenue. Einstein Predictive Sort helps shoppers find what they are looking for faster.

With a focus on Customization, low-code orchestration, and using data as intelligence, Salesforce really has turned the wheel on several products. For more details, you can browse to the Salesforce website here or refer to Marc Benioff’s keynote here.


Written by Nupur Singh, Sr.Technical Lead at Eternus Solutions
Read More »

How to Convert Attachments to Files in 9 Easy Steps!

It was Halloween and I was working on a customer’s environment who extensively uses Lightning Experience to search for an important attachment and to my surprise, it was not showing up in search. That was a scary thing, particularly on a Halloween night! I was mighty worried as it was an IMPORTANT file.


To verify, I had navigated to the particular record and saw that the file was present in the “Notes and Attachment” section. My sigh of relief could be heard miles away!


However, I was curious about what could cause it to not appear under search and to my surprise, I found out that this was an expected behavior, due to Attachments being superseded and replaced in favor of the more robust Files feature. Lightning Experience users can still view legacy attachments on records, however, they will not be returned in search results when performing a search from within the Lightning Experience. Strange, but true!

Additionally, in the Spring 17 release, Salesforce had announced that after Winter 18 release, the “Notes & Attachments” related list will no longer have an upload or attach button. Customers will be required to migrate to and adopt Salesforce Files. That rang the bell and made me research quite a bit on files.

What I found out…

I found out that Salesforce Files provide greater capabilities around sharing the file (or enhanced note) with other users, groups, or records, supporting file previews and revisions. So without wasting time, I searched for easy ways to migrate Classic Notes and Attachments to Lightning Files and Enhanced Notes. I browsed through salesforce release notes and blogs and finally Salesforce Lab came to my rescue. :)

There is an awesome app developed by Salesforce Lab - Magic Mover for Notes And Attachments to Lightning Experience

  1. Perform Pre-installation steps to enable “Set Audit Fields upon Record Creation” and “Update Records with Inactive Owners” 


  2. Install the App Magic Mover for Notes And Attachments to Lightning Experience from AppExchange.
  3. Perform Post Installation Steps for Admin and Individual Users to convert Private Attachment
    1. Assign the Attachments and Notes Migrator Permission Set to Admins
    2. Provide Modify All Data and Set Audit Fields upon Record Creation permission to Admin profile
    3. For private attachments, assign the Attachments to Files Permission Set to those Users
  4. Switch to “Attachment to Files” App and click on “Attachment to Files Tab”.
    1. In case Tab is not available, add it to related App and Profiles.



  5. Decide which Attachments need to be converted to Files



  6. Start the conversion



  7. After completion of process, you will see details updated in “Converted Attachments”. Voila! You’re done!



  8. Now when I search the document in Lightning Experience, I get the document in search results.



  9. Admin can decide whether to keep Attachments in the org or to free up the storage. To delete the attachment, admin can click on the delete icon.



Before I installed the app, I read through extensive documentation, which enabled me to bear a few things in my mind:

  • Perform Test load operation in sandbox before doing it directly in production
  • Communicate to your users about the bulk conversion process you’ll be undertaking with notes and attachments
  • If any of your users have private attachments, provide conversion instructions to them. Private attachments can be converted only by their respective owner.
  • It is recommended to turn off feed tracking for notes
  • Turn off the ability to create new attachments in the old Notes & Attachments related list within Salesforce Classic
  • Certain triggers may impact migration, so review any triggers in your org related to attachments or notes


Note: Orgs have a limit of documents and versions that can be modified in a 24-hour period. For most orgs, this is 200,000. The limit for “Content: maximum number of documents and versions in a 24–hour period” is listed in the Salesforce Developer Limits Quick Reference.

Turns out, Halloween wasn’t that scary after all! 


Written by Harshala Shewale, Sr. Technical Lead at Eternus Solutions
Read More »