Thursday 22 September 2016

Code Coverage Best Practices

6:32 pm
I know you are all familiar with code coverage in Apex and the requirement to have 75% of your code covered by automated tests. But do you know when is Code Coverage Calculated.

When Is Code Coverage Calculated?
The first thing to know is that the code coverage is stored when your latest test finished running. Each time you run the tests in a class, an entry is made in the code coverage table for each class you touch with those tests. The overall code coverage percentage in your organization doesn’t include code coverage from managed package tests. The only exception is when managed package tests cause your triggers to fire.

How to get the estimated the code coverage?
Re-run all tests in your organization:
---------------------------------------------------------------------------------
1a) Setup | Develop | Apex Test Execution
  b) View Test History
  c) Clear test data.

2a) Setup | Develop | Apex Classes
  b) Compile all classes

3a) Setup | Develop | Apex Test Execution
 b) Select tests | "My Namespace" | Select all
 c) Click run

4a) Setup | Develop | Apex Classes
  b) Estimate your organization's code coverage


What is Code Coverage Table?
It is used to display those blue and red highlights showing you which lines in a class are covered and which are not.


Why the Code Coverage Result is not updated during Deployment?
You may have notified that tests are automatically executed when doing a deployment. But please note that the relevant results of this calculation is NOT stored in the code coverage tables. The reason code coverage results are not stored on deployment is to support rollback.  The coverage is stored as data in its own transaction.  When you run tests in the developer console, you are not persisting anything to the data store besides these records.  With a deployment, you are modifying metadata in addition to running tests.  If a deployment fails, the entire deployment is rolled back.  If any coverage data were saved in a separate transaction, it could be pointing to lines that never existed and to classes that were never committed.


How can we get Aggregated Code Coverage result from SOQL?
We can using Tooling API to calculate the coverage individually for an Apex Class/ Apex Trigger/ overall Coverage. You can follow the steps mentioned below:

Open Developer Console > Execute the query with "Use Tooling API" checked

  • How many lines are covered for a specific class/ trigger:
SELECT NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverage WHERE ApexClassOrTriggerId =XXX
  • Which lines are covered for a specific class or trigger:
SELECT Coverage FROM ApexCodeCoverage WHERE ApexClassOrTriggerId = XXX
  • The current org-wide coverage: 
SELECT PercentCovered FROM ApexOrgWideCoverage

Why there is bad code coverage data for Apex Classes? And how to eliminate it?
There may be times where we see a different code coverage value than the actual value. This might be caused due to bad code coverage data or aggregate results from previous test runs. You can follow the steps mentioned below to eliminate any bad code coverage data in your organization:

Open Developer Console > Execute the below query with "Use Tooling API" checked
Select all the returned rows and hit "Delete Row" 

SELECT Id, NumLinesUncovered FROM ApexCodeCoverageAggregate WHERE NumLinesUncovered = NULL

Tuesday 20 September 2016

Salesforce Einstein across the Salesforce Platform

12:35 pm

Finally, Salesforce announced the launch of its Einstein artificial intelligence (A.I.) platform that’s implemented into several of the company’s existing cloud services: Sales Cloud, Service Cloud, Marketing Cloud, Analytics Cloud, App Cloud, Commerce Cloud, Community Cloud, and IoT Cloud.

Now, let's take a look at what Einstein will bring for each of Salesforce.com core product areas:


Sales Cloud Einstein will include Predictive Lead Scoring that enables sales reps to focus on closing the best leads, Opportunity Insights that alert reps when a deal is trending up or down, and Automated Activity Capture which seamlessly logs email and calendar activity with the right Salesforce record, and analyses them to deliver predictions. For more information on Sales Cloud Einstein, visit https://www.salesforce.com/blog/2016/09/artificial-intelligence-builds-olympic-sales-team.html



Service Cloud Einstein will include Recommended Case Classification which automatically pre-populates key case fields enabling predictive routing of cases to the right agent and enabling agents to resolve customer issues faster. With Recommended Responses service agents will be pushed the best responses, and Predictive Close Times will predict the time needed to resolve an issue, helping improve agent productivity. For more information on Service Cloud Einstein, visit https://www.salesforce.com/blog/2016/09/future-customer-service-introducing-einstein.html




Marketing Cloud Einstein will include Predictive Scoring which scores every customer’s likelihood to engage with an email, Predictive Audiences which builds custom audience segments based on predicted behaviors, and Automated Send-time Optimisation which predicts the optimal time to deliver messages based on past customer behaviour. For more information on Marketing Cloud Einstein, visit https://www.salesforce.com/blog/2016/09/intelligent-marketing-and-analytics-salesforce-einstein.html



Commerce Cloud Einstein includes Product Recommendations to personalise product recommendations to shoppers, Predictive Sort which will infuse personalised sort and search results based on likelihood to engage, and Commerce Insights that will help retailers understand product purchase correlation to power smarter merchandising and store planning.




Community Cloud Einstein now includes Recommended Experts, Articles and Topics to suggest posts, articles, experts and topic pages; Automated Service Escalation which automatically creates a case in Service Cloud if customer posts do not receive a timely response; and Newsfeed Insights which highlights the most relevant and popular content in every feed. For more information on Community Cloud Einstein, visit https://www.salesforce.com/blog/2016/09/salesforce-einstein-smarter-productive-connections.html


Analytics Cloud Einstein will deliver Predictive Wave Apps that uncover future patterns for any business process, Smart Data Discovery that helps users find and explain insights from millions of data combinations in minutes, and Automated Analytics & Storytelling which will automate and prioritise the next insight users need to know. For more information on Analytics Cloud Einstein, visit https://www.salesforce.com/blog/2016/09/iot-cloud-einstein-farewell-dumb-iot.html



IoT Cloud Einstein will include Predictive Device Scoring which will score data from connected IoT devices, Recommend Best Next Actions for service processes and marketing journeys based on the scoring of that streaming device data, and Automated IoT Rules Optimisation which will actively update the rules that govern how IoT data is managed. For more information on IoT Cloud Einstein, visit http://sforce.co/2cgTDT5


To learn more about Salesforce Einstein?
https://www.salesforce.com/products/einstein/overview/
https://trailhead.salesforce.com/module/ai_basics
http://forceastute.alexislam.com/2016/08/salesforces-next-ai-product-salesforce.html







Saturday 17 September 2016

Using Lightning Bolt to create Next-Gen Communities

10:52 am
What's lightning Bolt?
A new framework for deploying next generation communities and portals faster; A componentized portal building tool was made available to 11 Salesforce partners to create a dozen business-specific portal templates that include built-in logic and workflow, like recommendation engines, e-commerce, and case management. Like the original templates, these are integrated out-of-the-box with Salesforce’s popular customer relationship management (CRM) system and with the Community Cloud, and can be connected via API to other systems.



Built on Salesforce, Powered by Lightning

Last year, Salesforce introduced Lightning Templates for Community Cloud, enabling companies to quickly create customized communities for their customers, partners and employees. Since then, companies have used these templates to create nearly 1,000 Lightning Communities to connect and collaborate in new ways. And because Bolt solutions are built on the Salesforce platform, companies can be confident that every customer interaction is automatically captured in Salesforce CRM. With predefined features and themes for specific purposes and industries, the new templates for Community Cloud provide "a great starting point" for setting up communitiesWith predefined features and themes for specific purposes and industries, the new templates for Community Cloud absolutely provide "a great starting point" for setting up communities!

New Bolt solutions being introduced today include:

Community for Insurance Agents by Accenture —Insurance companies can now supercharge agent and advisor productivity and deepen channel engagement by equipping agents with new self-service capabilities, data-rich dashboard features like Agent360, and sales productivity tools in a modern, easy to use, and mobile-friendly portal.

Store Operations by Accenture – Retail store personnel can now collaborate with team members in their store and other stores around the world to access knowledge about products, staffing, and other store operations in real time, using any device. This solution allows retailers to operate each store more efficiently and with greater customer satisfaction.

Retail Store Collaboration by Appirio —Retailers can now collaborate better with their stores, getting real-time information about consumers, improving worker engagement and accelerating the feedback process necessary to scale their business.

Lightning Commerce by CloudCraze —Sales reps, service employees and customers in the field that are leveraging CloudCraze’s native commerce application can now rapidly configure and deploy multiple purchasing scenarios that provide all users a streamlined customer experience, such as ordering spare parts or collaborating on a complex set of services in just a few clicks on their mobile devices.

Mortgage Broker by Cognizant —Financial service organizations like Barclays can now create personalized experiences for their brokers, tailoring solutions based on deal value and the type of products they work with and centralizing the information just one-click away from the homepage.

Customer Service for Manufacturing by Deloitte —Manufacturing companies can now facilitate more meaningful communications between customers and sales reps, empowering them to have real-time conversations with customers, offer timely service and get feedback through satisfaction surveys to continuously improve performance.

Patient Community by Huron and Cancer Treatment Centers of America - Patients of healthcare facilities can now connect through a community platform that empowers them to seek and offer support from those who have gone through similar experiences while gaining access to educational resources, group collaboration, local support group events, and tools to document their journey.

Retail Audience Engagement by Magnet 360 —Retailers can now connect with customers, partners, and employees at scale with a rules based chatbot, creating a more personalized and efficient experience.

Supplier Marketing Community by PwC —Working with a top 10 retailer, PwC developed a Bolt solution- Supplier Marketing Community - to link their marketing, CRM, merchandising and analytics efforts on one centralized platform, giving them better insight into ROI, buyer trends and increasing overall cost efficiency.

Patient Scheduling by Silverline —Clinical organizations, whether hospitals, practices, clinics or specialty services like MYnd Analytics, are now able to offer their patients real-time scheduling, so patients can easily get in to see their doctor when they need to.

Retail Clienteling from Traction on Demand — Retail store managers and associates are able to quickly access customer information, preferences and purchase history from all channels that the brand and customers interact through. This community will help retailers provide a seamless customer experience both online and in-store.

Retail Store Operations by Cadalys —Store employees, field leadership and headquarters personnel can now work together more efficiently and effectively with capabilities such as communications management, task management, holds and recalls, space and fixture management, “Leader on Duty” performance, petty cash management, real estate operations and expense reporting.

PartnerFirst by 7Summits – Technology companies are now able to connect and engage with their partners in a whole new way with personalized dashboards that surface actionable insights, streamline onboarding, and allow for deal room collaboration, as well as deal registration – all from a single consolidated solution.


Salesforce said the Lightning Bolt framework will be made generally available this October, under its Community Cloud. Customers can start building their Salesforce Lightning Bolt apps now, before distributing them next month. However, regular developers will have to wait until early next year before they can begin distributing their apps on Salesforce’s AppExchange.

Thursday 15 September 2016

Happy Mid-Autumn Festival!

10:19 am



A very happy mid autumn celebration to all!
추석잘보내세요
中秋節快樂
Happy Mid-Autumn Festival


Please note (Elufa Systems Ltd.) our office in Hong Kong will be closed on Friday, September 16th, 2016 for national holidays for Mid-Autumn Festival. We will resume operation on Monday, September 19th, 2016. If there are any urgent matters to be processed, please advise us as early as possible.

Thursday 8 September 2016

Salesforce buys #1 Text Messaging Apps Company HeyWire

11:00 am


ref: http://www.heywire.com/blog/salesforce-announcement/

Salesforce has signed a definitive agreement to acquire HeyWire. HeyWire, an enterprise mobile messaging company. In 2008, HeyWire launched the world’s first implementation of ‘mobile cloud messaging’. Instead of being associated with a physical mobile device, an SMS message could be associated with the identity of the individual (via the phone number), thus allowing text messages to be sent and received from any device, anywhere and at any time.


ref: https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000q4L5EAI

It has launched HeyWire Business Messenger, its text messaging platform for sales and customer service, on the Salesforce.com AppExchange.




HeyWire Business Messenger, available for iOS and Android, allows sales and service people to text from their phones or tablets using their business phone numbers, take control of dialogues with customers, and retain them in Salesforce.com activity records, as well as in HeyWire's secure cloud messaging platform, with one tap.

With Heywire Business Messenger -2-Way SMS for Field Service and Customer Management, users can do the following:

✔ Use existing business phone numbers
✔ Text to Salesforce.com leads and contacts
✔ Auto-identify existing leads and contacts when receiving texts
✔ Retain text conversations in Salesforce.com with one tap;
✔ Link to Salesforce1 mobile app to access and upgrade records
✔ Set personal signatures and auto-replies
✔ Lock apps with TouchID or Passcode to keep messages safe;
✔ Text from desktop, tablet, phone, or Apple Watch
✔ Authenticate using secure Salesforce.com logins; andArchive all messages in HeyWire's secure cloud messaging platform




ref: https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5hBtEAJ

HeyWire also offers on the Salesforce.com App Exchange HeyWire LiveText Agent, which enables text conversations between customers and contact center agents using existing business toll-free numbers, users can do the following:

✔ Enables landline texting to office & 800 numbers
✔ Integrate SMS texting with custom workflows with Lightning Process Builder
✔ Seamlessly adds 2-way conversational texting channel
✔ Standard SMS text messages - no customer app needed
✔ Sync & log text chat with leads, contacts, person accounts
✔ Bulk SMS text messaging campaigns & lead nurturing
✔ Initiate outbound texts, better than live chat
✔ Automate appointment reminders, notifications, interactive text response (ITR), text-to-case
✔ Omni-Channel integration for smart routing
✔ Capture data for customer feedback & analytics
✔ Support multiple, simultaneous, two way texting chat sessions
✔ Picture messaging or MMS to send/receive customer photos
✔ Complete SMS text solution, no other app or subscriptions required
✔ Business-class text platform; over 8 billion texts & counting
✔ Add a click-to-text feature to your website
✔ Compatible with Sales Cloud Console, Service Cloud & Lightning

Wednesday 7 September 2016

Are You Ready for Winter17' release?!

4:08 pm
Winter17' Release will be ready in Sandboxes from 9th September. So, it's the time to browse at the Winter17' Release notes now!

Sign up for this webinar and find out about all the new features!
https://www.salesforce.com/form/event/release-readiness-winter-17.jsp





Top Release Features:  http://www.sfdcstatic.com/assets/pdf/misc/winter17-release-review.pdf
Winter17' Release Note: https://resources.docs.salesforce.com/204/latest/en-us/sfdc/pdf/salesforce_winter17_release_notes.pdf


Some key features from the Winter '17 Release:

Sales Cloud

Predictive Lead Scoring (Pilot): Sales Cloud, the world's #1 sales app, has Predictive Lead Scoring, which allows you to take company data and put it to work for you.

Salesforce Inbox

Activity Intelligence (Beta): Automatically capture all emails and events in Salesforce so you can focus more on selling and building customer relationships.

Service Cloud

Lightning Open CTI: The world's #1 customer service app, Service Cloud, now has the power of computer-telephony integration (CTI) in Lightning. Connect to customers and resolve issues faster with Lightning Open CTI.

Marketing Cloud

Predictive Lead Scoring: The world's #1 marketing app now empowers you to score every customer's likelihood to engage.

App Cloud

Lightning Navigation and Customization: The #1 Enterprise App Dev Platform, App Cloud, allows you to get to your apps quickly with fewer clicks with the new navigation bar and new customization capabilities.

Analytics Cloud

Wave for Sales 2.0: Bring actionable analytics to Sales Cloud customers with predefined accelerator templates, customized for every sales user.

Community Cloud

Themes in Lightning Communities: Now you can create and apply a custom community theme to match the look and feel of your brand. Customize the look and feel of your community with ease.

Financial Services Cloud

Lightning Client and Household Profiles: With Lightning App Builder, you can now customize your client and household views with drag and drop configuration.

Health Cloud 

Care Plan Templates: With Health Cloud you can now save valuable time with customizable care plan templates.

Cloud Services

Signature Success Plan: Combine a high-touch team of Salesforce experts and the right proactive and prescriptive services to achieve business value faster.




Back to Top

What I Can Help

SALESFORCE CUSTOM SOLUTION DESIGN

SALESFORCE STRATEGY AND PLANNING

Do you wanna share posts

I am always looking for writers that have something interesting to say about Salesforce. Whether you have a post in mind or would like to collaborate on one, get in touch! - Click Contact Me