Thursday, 28 July 2016

Salesforce Wave?!

6:11 pm

You probably know that Wave is a great way to explorer your Salesforce data in ways that standard analytics cant. If you haven't used Wave yet, you should explorer now! Trust me as it's awesome.



Salesforce University is the official certification training department of Salesforce. That's why I decided to take the official training courses and learn this new "technology". You may not yet have taken a good look at he product.

Wave Analytics is a self-service analytics application that enables you to make sense of large amounts of data. You can explore your data to discover new, unexpected insights. You can also create dashboards to continually monitor key business metrics based on the latest data.
How does it work? Create aggregated views of your disparate data—Salesforce or external data—by loading it into datasets, and then slice and dice the data to get the answers you need to run your business. All inside Salesforce. Save your insights, share them with others, and start discussions about them in Chatter.



A few observations I made about Wave from the training course:

Wave is easy to use. Even end-users with minimal training, end-users can group data and get quick statistical facts that can help make conclusions about the data. Just seeing the images on the screen around is fun to watch, and it works on mobile devices.




Key features:

  • Support multiple data sources: Wave allows users to vie data present not only in Salesforce, but also from various other databases via connector for various ETL tools like Informatica and Mulesoft. 
  • Data drilling: Wave allows user to drill into the dashboard data with a single click
  • Easy sharing: Wave allows users to share the dashboard data either via a Chatter, post, the URL, or by sharing the downloadable image of the dashboard.


If you have not seen Wave or would like to feel the power of the product, please feel free to contact us.


Wednesday, 27 July 2016

Lightning or Visualforce?

12:39 pm
Visualforce and Lightning both offer ways to design and create custom interfaces for Salesforce. There are lots of questions in the mind of SFDC developers & customers regarding Lightning but the question which comes in every SFDC dvelopers' & customers' mind. Should our Salesforce organization switchng off the old UI?

Let’s explore the differences between Lightning and Visualforce.

Visualforce 


The Visualforce framework  was first launched back in 2008 and it provides a robust set of tags that are resolved at the server-side and that work alongside standard or custom controllers to make database and other operations simple to implement. This is a Page-Centric model. This means that the intent of Visualforce was to create something that was your full page interface with Salesforce. When the user needed to perform some kind of operation, like Save a record, it would send that request to the Salesforce servers and then reload the entire page with the new state of the UI. All back-end processing is done with Apex Code on the Server-Side. You have the option to inject JavaScript into the mix to handle some of the Client-Side processing, but it isn't the default interaction methodology.

What a Visualforce framework includes:

  1. Visualforce Page - HTML-like markup language used to design the layout of the page.
  2. Standard Or Custom Controller - Apex Code to handle Server-Side operations executed from the Visualforce page (EX: CRUD operations).
  3. (Optional) CSS Styling - Style your Visualforce page to look a specific way within the header or by file reference.
  4. (Optional) JavaScript - Used to handle Client-Side processing or to be coupled with CSS for a cosmetic revamp of the UI.
  5. (Optional) Apex Extensions - These are used to preform logical operations that are not housed within the standard or custom controller.



Lightning

Lightning Components entered beta in the Spring 15 release, and it was designed to follow an App-Centric model. This means that it has been designed to create self-contained components that build on top of each other. To put this in perspective, with Visualforce you would send an interaction to the Salesforce server and then update the entire page. However, with Lightning you can send an interaction to the Salesforce servers and then update a specific component. And Lightning components are part of the new Salesforce user interface framework for developing dynamic web applications for desktop and mobile device.


What a Lightning Component Bundle includes:

  1. Component - Markup language used to structure the layout of the component.
  2. CSS Styling - Used to change the cosmetic look or style of the component.
  3. Controller - Use a JavaScript Controller to handle Client-Side logic processing or use an Apex Controller to handle Server-Side logic processing.
  4. Design File - Used to describe the design-time behavior of the component when used in Lightning Pages, Lightning App Builder, or in Community Builder.
  5. Documentation File - Provides sample code or reference documents for others to use when they get your component.
  6. Renderer - Used to override the default Client-Side render settings of a component.
  7. Helper - Used to store reusable JavaScript functions that are handled by the Renderer or Controller as well as executing Server-Side actions.
  8. Optional: SVG File - Allows you to include custom icons for reference within your component.







Is there a way to convert Visualforce to Lightning?
The answer is No. They are two different frameworks. The only thing they have in common is that they use Apex as their controller layer (this is optional in Lightning as components have their own javascript controller), but the Apex will need re-developed/refactored to support Lightning.


When you should use Lightning?

  • If you are developing for Salesforce1 Mobile Application as you can create a custom Lightning tab that points to your component and include that tab in your Salesforce1 Mobile navigation.
  • If you are non-developer but you need to build apps by assembling standard or custom components, you should use Lightning App Builder and Lightning components for custom components.
  • If you are building a Community for Customers you should use Community Builder to create a Lightning-based community site leveraging Lightning components.

Wen you should continue use Visualforce?
  • If you are rendering pages as PDF in your application use Visualforce. Lightning components don’t support rendering as PDF output yet.
  • If you are exposing a Public-Facing Unauthenticated Website continue using Visualforce. Lightning components don’t support an anonymous (unauthenticated) user context yet.
  • If you are building an interactive experience with Javascript and you need third party Framework you should use Visualforce as a container for third party Framework
  • If you are adding to an existing project with lots of Visualforce Pages continue to use Visualforce. - as your company may have invested too much in it and VisualForce :)


To learn more about Salesforce1 Lightning or on How to Use the Developer Console to create components, visit salesforce.com/lightning.


Tuesday, 26 July 2016

Several ways for you to know how to share records in Salesforce

12:35 pm
Before you start with developing Sharing rules, be aware of the following forces that will restrict you from sharing records in objects with a users:

  1. License Type
  2. Profile 
  3. Permission Set
  4. System Remission
Do you know what is the difference between "Salesforce" and "Salesforce Platform"? When creating or editing a Salesforce User, there is a picklist field that lets you assign a specific User License. 

Salesforce licenses are designed for users who require full access to standard CRM and Force.com AppExchange apps. CRM apps are anything that requires access to Standard Objects like...
  • Leads
  • Opportunities
  • Forecasts
  • Cases
  • Solutions

Salesforce Platform licenses are designed for users who only need access to custom apps, and NOT the standard CRM functionality. Salesforce Platform users DO have access to the "core" Salesforce Standard Objects and functionality, like...
  • Accounts
  • Contacts
  • Reports
  • Dashboards
  • Documents
  • Custom Tabs

Now the question becomes: How can you ensure data security?






Monday, 25 July 2016

Aggregate Query has too many rows for direct assignment, use FOR loop

6:51 pm

"Aggregate query has too many rows for direct assignment, use FOR loop "

Have you even experience this error message? The implication is that, somewhere, your code included an aggregate query, and while it’s returning not enough rows to generate a governor limit error, it is somehow returning enough rows to generate this error.

As per this Salesforce doc, this exception is sometimes thrown when accessing a large set of child records of a retrieved sObject inside the loop, or when getting the size of such a record set. To avoid getting this exception, the best practice is to use a for loop to iterate over the child records.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_loops_for_SOQL.htm

Okay then, I try to use the for loop to iterate over the child records as follows:

The query runs just fine. But later, I wind up with another fatal  error:
INVALID_QUERY_LOCATOR: invalid query locator

This looks pretty hopeless - can't exceed limits, and there's no way to check if we're exceeding limits. 
After a lot of trial and error, I finally determined that I don't have any solutions to resolve this issue. The workaround is that using a try-catch like below: 








Or, if you know the child record IDs, please use the retrieve call instead.










What is an aggregate query?
The SOQL documentation doesn’t explicitly define the term “aggregate query,” but it does describe “aggregate function” by saying, “Aggregate functions include AVG(), COUNT(), MIN(), MAX(), SUM(), and more.” It’s the “and more” that is relevant here.
In the section on “Understanding Relationship Names, Custom Objects, and Custom Fields,” the SOQL documentation describes a query that traverses the parent-to-child relationship as a type of aggregate query. So even though our original query doesn’t use any aggregate functions, it’s considered an “aggregate query” because the sub-select clause traverses the parent-to-child relationship.



Follow by Email

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