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 »

Tuesday, 31 October 2017

4 Reasons Why AppExchange is More Powerful than ever Before!

Salesforce AppExchange, the #1 cloud marketplace, is a proven ecosystem of apps with millions of installs and thousands of customer reviews to help you find the best match for your business. As of 24th Oct 2017, Salesforce went for a complete revamp of the AppExchange UI. What this essentially means is that while AppExchange just a Marketplace for Applications earlier, which then went on to list Components too, it now lists Lightning Data and Lightning Bolt as well!


1. Salesforce Welcomes New members to the AppExchange Family

Salesforce has added 2 new members to the AppExchange family: Lightning Data and Lightning Bolt.

Lightning Data gives access to specialized data set which customers can buy, leading to a definite boost for their Sales and Marketing teams with pre-integrated, approved and scalable data solutions.


Lightning Bolt Solutions allow Partners to publish pre-built templates which can be used by customers to create next-gen communities and portals.




2. Everything is just 2 clicks Away!

The Salesforce UX team has worked really hard to make customers’ life easy. Earlier, users needed to click a minimum of 3-4 clicks for getting information about the App provider. Now, everything is just 2 clicks away, with  all the required information about the Application and App vendor available on a single tab, with reviews moved to a separate tab.

Application Listing Old UI

Application Listing New UI



3. A Smarter Search

In another good example of UX, AppExchange now saves your recent search items to make it available for later use, helping the customers who may have searched for a lot of applications.



4. Salesforce’s other Marketplaces are also under same umbrella

Earlier, Salesforce had different Marketplaces for Heroku elements, Marketing Cloud apps and so on. With the recent revamp, you can find other apps like Heroku elements, HubExchange (Marketplace for Marketing cloud applications), Link Marketplace (Marketplace for eCommerce Solutions) on the same integrated platform called AppExchange.



Salesforce has taken cognizance of all customer pain points and turned AppExchange into an all-encompassing, powerful and customer-oriented Marketplace. A detailed description of all new AppExchange features can be found here.




Written by Purushottam Bhaigade, Technical Lead at Eternus Solutions
Read More »

Monday, 30 October 2017

AppExchange 2.0 Secrets Unleashed for Salesforce Partners

Had Marc Benioff not gifted the phrase “App Store” to his mentor and friend, the late Steve Jobs, the AppExchange would have been known as the Salesforce App Store today.

With 4000+ solutions, 5 million+ app installs and 87% of Salesforce customers using AppExchange apps, the 2005 born, 11-year-old AppExchange has come a long way from merely being an apps listing service to a powerful community of business apps, customers and partners. Its recent makeover unveiled on 24th Oct, 2017, therefore, is nothing short of a rebirth, making it 'The AppExchange 2.0'.

The Salesforce partner ecosystem is one of the pillars and the largest contributors fueling the Salesforce economy, which is forecasted by IDC to drive 3.3 million jobs and in excess of $859 billion in revenue by 2022. Hence, awareness of how this Appexchange makeover empowers Salesforce Partners by marrying their interests, is of essence.


Defining App USPs Was Never Significant Than Now

Powered with an intelligent search which recommends all the relevant and similar apps to the customers, the new Appexchange provides them with a la carte menu of apps to choose from in a particular category. For e.g. when I search the term “documents”, the search results consist of all relevant apps, consultants, industry solutions around document generation or a similar feature.


This makes it imperative that ISV partners clearly define their application’s unique selling point, from that of your competitors, thus enabling customers to make informed buying decisions.


Tighten Loose Industry Specific Nuts With Lightning BOLTS

With Lightning Bolts, ISV Partners now have the power to package industry specific process flows, apps and lightning components as predefined solution templates, leading to faster deployments and go to market, without having to reinvent the wheel. A great example of this is a promotion management and communications Lightning Bolt solution for the Retail sector offered by Appirio.


This enables ISV Partners to carve their niche within an industry vertical, and helps them emerge and be recognized as industry leaders rather than just application providers.


Brand Your Product And Industry Expertise

AppExchange 2.0 brings in two important perspectives of categorizing solutions with their relevance to industry vertical using Industry collections, and with relevance to a specific Salesforce product using Product Collections. This provides Salesforce Partners, with an opportunity of being recognized as not only an expert in the relevant industry vertical, but also, in a respective Salesforce product umbrella.


For e.g. Product collections for Sales Cloud provides solutions addressing A to Z needs of the sales process, starting from unlocking sales channel to driving sales rep productivity.




Shorter Application Issue Resolution Cycles

Dealing with technically aware and well informed customers is a dream come true for product support reps and AppExchange 2.0 has made this a reality. AppExchange 2.0 not only provides a wide array of apps to thee Application users to choose from, but also goes a step ahead and empowers them through recommendations of relevant and applicable Trailhead self-learning modules.

This inevitably results in a smarter and cognizant generation of application users along with shortened issue resolution cycles.


Show Them The Money

Business plans sculpt the blue print of your apps by pushing Salesforce partners to ponder over key aspects such as target audience, potential revenue forecast, customer pipeline etc. thus enabling you to build an awesome business app.

As it is rightly said “Don’t just build a product, build a business around a solution that solves business problems” and staying true to this, AppExchange 2.0 empowers partners to not just think about the application architecture and design, but also a sustainable long term business plan, blending it beautifully within the listing setup of the Partner Community.


Last but not the least, the Appexchange makeover is a force to reckon with, which complemented with the powerful partner ecosystem, will prove a game changer in times to come.




Written by Jigar Shah, Enterprise Solution Architect at Eternus Solutions
Read More »

Tuesday, 17 October 2017

Understanding – Time to First Byte



Introduction


I faced slow website loading in a project and I am sure many of you must have faced the same. Now-a-days, people are worried about responsiveness of web server and speed of their websites. There are many reasons as to why your website might be slow! Typically, the most common reasons are inappropriate hardware configuration, incorrect coding practises, slow internet connection and so on. Apart from these, there is an overlooked but highly important factor that degrades the performance of your site and that is TTFB - Time to First Byte.


What is TTFB?


TTFB – Time To First Byte, is a metric to measure responsiveness of web server and speed of website. In simpler words, it is the time any browser has to wait for the first byte to be received. TTFB is not the only metric to measure the speed of your site. In spite of this it cannot be overlooked.

Organizations make use of TTFB to identify the weak points like speed of their website when they make http request. By identifying the weak points, they know whether it is a server configuration issue or an application issue etc.

Following is the illustration of TTFB seen in Chrome Developer Tools. There are also various other components in the image below starting sequentially is Request Sent, TTFB and Content Download of the website.

The Request sent to the server took 0.16 ms which is acceptable. Then there is a waiting time for the content to be downloaded. This waiting time is TTFB where we receive the first byte of the response. So TTFB is the first thing that we have received before the content is downloaded and TTFB for current site request is 2.85 seconds which is huge. Finally, the content of website like CSS, images and scripts and so on, are downloaded in 8.55 ms which is also acceptable. So we can easily understand from the image below that TTFB is the first byte that we receive even before the content is downloaded.


Tools for Testing TTFB


There are various tools available online to test the performance of your site. Testing the performance of your site is indirectly, nothing but measuring TTFB. Following are the free tools you can use to measure TTFB of your site:-
  1. WebPageTest
  2. Google Chrome – Developer Tools (this is recommended as it is default integrated with Google Chrome Browser)
  3. Pingdom
  4. KeyCDN

TTFB Impacted by/Causes of High TTFB


TTFB is impacted by many factors, there are reasons as to why your TTFB is high. Following are some of those reasons:-

1. Server Configuration
The first thing that hits us is inappropriate server configuration. Off course, inappropriate server configuration is one of the major reasons to high TTFB. If your server configuration is inappropriate it will affect the performance of your site. It can make the processing of any request slow which will in turn result in high TTFB and the performance of your site will degrade.

2. High CPU Usage
Even if your server configuration is good your site might perform slow. Reasons to high TTFB are innumerable, one of which is High CPU Usage. If the CPU usage of your server is high it might degrade the performance of your site. Your server will not be able to process your requests quickly.


3. Slow Database Request
Slow Database Request is also one main reason for slow performance of your site. If your database is not structured well(indexes) or your query is not well-formed, then it will for sure add some delay in execution and will result in slower performance of your site.

4. Inefficient code on server
One of the main reason for slow performance of your site is inefficient code. Inefficient code will slow down the execution of your application and also will ultimately increase the CPU usage which will result in slow performance of your site. So, it is recommended that you always use best coding practises for your application.


Effect of TTFB

TTFB strongly affects the search ranking of your site. If TTFB of your site is high then it will affect the ranking of your site by not listing it at the top when searched. So the ranking of your site is directly linked to TTFB of your site. Though TTFB is not the only metric of low ranking of your site, however, it plays a major role in ranking of your site.

Improving TTFB


Improving TTFB can greatly help you increase the performance and speed of your site. Improving TTFB is nothing but reducing the TTFB number i.e. if the TTFB of your site is 4 seconds then you can improve TTFB of your site to 1 second. Following are the ways you can improve TTFB of your site:-

1. Improve your server configuration
Good server configuration can ultimately increase the speed of your site. It will automatically perform faster in serving end user’s request and also can speed your database queries and application processing. You can add a load balancer to improve the performance of your site. Load balancer balances the requests received by end user when actual server is running out of memory. Your load balancer server will just perform like your actual server.

2. Implementing CDN
A CDN is a spread over network which delivers html pages and other web contents from the server to end user based on their geographical locations, the origin of the web page and content delivery server. Implementing a CDN is a really good idea to improvise the performance of your site. Fetching everything from your hosting server over the network can cause latency and will reduce the performance of your site. Thus implementing a CDN will really be helpful if the request is from where the CDN server is present and will not cause any network latency. Ultimately improving the performance of your site.

3. Caching 
Caching is a process of temporarily storing the data you request in cache. For example, the files you automatically request by looking at a Web page are stored on your hard disk in a cache subdirectory under the directory for your browser. When you return to a page you've recently looked at, the browser can get those files from the cache rather than the original server, saving you time and saving the network the burden of additional traffic. Caching is a good technique to increase the performance of your site. It is mainly used for static content of your site. It will also reduce the network latency of your requests, thus increasing the speed and performance of the website.



Conclusion

TTFB is an important metric in measuring the performance of your site. Above mentioned measures to improve TTFB are fairly simple to implement. A TTFB time of 500 ms or less is recommended.



Written by Rohit Sevaramani, Tech Lead (MCP) at Eternus Solutions
Read More »