Salesforce Development and Administration

This blog is about Salesforce Development and Administration. We will provide Salesforce training blog post on salesforce, salesforce administration. We will cover development topics on apex, visualforce, process builder and new upcoming topics like salesforce dx, vscode, salesforce Einstein and Platform events.

Wednesday, April 25, 2018

Mick Wheeler (http://www.mickwheelz.net) recently announce on twitter about an interesting tool he created to fetch the source code from git, spin up a new scratch org and push the source code into this newly created scratch org. In addition to this, you can run an apex class in this org using this tool after the source code is pushed. The tool is built using node.js. People having knowledge of node.js can have a peek at the source code in github at https://github.com/mickwheelz/AutoScratcher.

Ofcourse the tool can be enhanced to perform more sfdx supported operations like running test classes, loading data etc.

Wednesday, October 18, 2017

Wade Wegner who is Vice President Salesforce DX/Salesforce today(17th Oct 2017) announced that Salesforce DX is now Generally Available for all. He announced this on Twitter through this pinned tweet "I'm incredibly excited to share that #SalesforceDX is now GA. Congrats to an amazing team & thanks to all of you!" and through the Salesforce Developer Blog https://developer.salesforce.com/blogs/2017/10/salesforce-dx-is-now-generally-available.html.Please note that the Salesforce DX was previously in Open Pilot for some time and then through last few months it was in Beta. Even in Beta phase it was quite stable. Customers can enable Dev Hub on their production org or if they want to try Salesforce DX, they can register for a trial dev hub org through this linkhttps://developer.salesforce.com/promotions/orgs/dx-signupOnce registered the users can download the CLI tool (https://developer.salesforce.com/tools/sfdxcli)and use it to do development, create scratch orgs, push and pull source code from these scratch orgs.Developers can also use it to deploy and retrieve metadata from Sandbox and Production orgs. They can even use it for destructive deployments for deleting metadata from the orgs.Visual Studio Code is now officially supported Text Editor instead of Force.com IDE which is not very surprising for most developers as Force.com IDE which is eclipse based in very challenging to work with.The Visual Studio Code editor has nice code completion feature implemented using Apex Language Services. Syntax highlighting for Visualforce and HTML code is supported.Since Salesforce DX CLI tool can output json it is very useful for chaining of tasks and scripting in CI/CD Tools like Jenkins.We have created several videos on Salesforce DX. Please visit our channel to find out more.Here is the link https://www.youtube.com/channel/UCg8_QWMEUaCavDmJTVLl-aQ
Some important videos from our channelDestructive Deployment using Salesforce DX CLIhttps://www.youtube.com/watch?v=PNwzTFz3-4M

The Lightning Component framework is built on the open source Aura framework.

What is Lightning Experience

Lightning Experience is the new, modern user experience and interface for using Salesforce.

It has a modern and responsive design. It is optimized for users so that they can work very fast and easily on records so that they are more productive.

Not every feature of Salesforce is supported in Lightning Experience yet. Because of this, Salesforce Classic – is still available, and users can switch between Lightning Experience and Salesforce Classic with ease.

It is not necessary for the entire org to move to Lightning Experience at the same time. Certain users can enable Lightning Experience, while others can continue using Salesforce Classic.

Admins can enable Lightning Experience access at the user, profile, and organization level.

What are Lightning Apps?

Lightning Apps are made of Lightning components.

Lightning App is a special top-level component whose markup is in a .app resource.

You can Access app using url of this pattern https://.lightning.force.com//.app

Mark up starts with

Types

Standalone – can be hosted outside SF1 and LE, like lightning out and VF pages

Lightning Experience and SF1 – Can take advantage of record create and edit pages, among other benefits

What is pre-requisite for learning Lightning component development?

Learn JavaScript. You must have intermediate level of JavaScript knowledge.

Learn concept of web components like google polymer, react,etc

Learn Single page app concept.

CSS3 Knowledge.

JavaScript debugging.

Apex knowledge for server side logic coding.

What is a Lightning Component Bundle? OR What is a Lightning component made up of?

A component bundle contains a component or an app and all its related resources.

CSS Styles

Controller

Design

Documentation

Renderer

Helper

SVG File

What are the types of events in Lightning?

Component events are handled by the

component itself or

a component that instantiates or contains the component.

Application events are handled by

all components that are listening to the event. These events are essentially a traditional publish-subscribe model.

What is @AuraEnabled annotation used for?

The @AuraEnabled annotation enables client side access to an Apex controller method.

The Salesforce Lightning Design System includes the resources to create user interfaces consistent with the Salesforce Lightning principles, design language, and best practices.

It helps to create an intuitive UI with less number of clicks which is modern and beautiful.

What is the use of access=“global”?

Mark your resources, such as a component, with access="global" to make the resource usable outside of your own org. For example, if you want a component to be usable in an installed package or by a Lightning App Builder user or a Community Builder user in another org.

What are Component Attributes?

Component attributes are like member variables on a class in Apex.

They are typed fields that are set on a specific instance of a component, and can be referenced from within the component's markup using an expression syntax.

Attributes enable you to make components more dynamic.

Use the tag to add an attribute to the component or app.

All attributes have a name and a type.

Attributes may be marked as required by specifying required="true", and may also specify a default value.

What is Lightning Data Services?

It is data Layer for Lightning

Can be equated to Standard Controllers in Visualforce

Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code.

Sunday, September 24, 2017

Dreamforce is the learning event of the year and the largest software conference in the world. It is hosted by Salesforce in California USA. It started 15 years back and Salesforce has been hosting this every year since then.People from all around the world attend this event. It is a dream of every developer to attend this event once. There is lot of learning in this event as all the who's who of Salesforce and World give sessions in this event. The sessions are on variety of topic. Salesforce customers and partners showcase their solutions and products in this event. For 2017, Full Conference pass is already sold out. It will be a 4 day event with more than 2700+ sessions on varied topics. It will be starting Monday, November 6, 2017 and will end on Thursday, November 9, 2017. Here are some important links for 2017Schedulehttps://www.salesforce.com/dreamforce/schedule/List of finalised sessionshttps://success.salesforce.com/sessions?eventId=a1Q3A00000stRRuUAMRegistration linkhttps://www.salesforce.com/dreamforce/register/

Allows one piece of software to make use of the functionality or data available to another system.

Examples in Salesforce

Bulk API

Metadata API

Streaming API

3. What is Remote Site Settings used for?

Before any Visualforce page, Apex callout, or JavaScript code using XmlHttpRequest in an s-control or custom button can call an external site, that site must be registered in the Remote Site Settings page, or the call fails.

In this setting, You need to specify the URL that you want to access.

You can deactivate the setting if needed.

4. What is Oauth?

OAuth (Open Authorization) is an open standard for token-based authentication and authorization on the Internet.

It is a way for Internet users to grant websites or applications access to their information on other websites but without giving them the passwords.

It is used by companies such as Google, Facebook, Microsoft and Twitter to permit the users to share information about their accounts with third party applications or websites.

5. What is JSON?

JSON or JavaScript object notation is an open standard that uses human readable text to transmit data consisting of key-values and arrays.

It is a lightweight data-interchange format.

It is very easy to read and write. It is concise and lightweight.

It is a very common data format used for asynchronous browser/server communication, including as a replacement for XML in some AJAX-style systems.

JSON is a language-independent data format

JSON is text, and we can convert any JavaScript object into JSON, and send JSON to the server.

We can also convert any JSON received from the server into JavaScript objects.

6. What is cURL used for?

cURL is a command line tool for getting or sending files using URL syntax.

Streaming API can be used to get a real time notification of data changes in Salesforce.

The matching data criteria( for the data for which we want to receive notification) can be defined using a SOQL query.

It is much efficient than the clients who continuously poll the server.

It internally uses Bayeux Protocol.

17.What is Lightning Connect?

Salesforce Connect is a framework that enables you to view, search, and modify data that’s stored outside your Salesforce org. The data can be on premise (e.g. SQL Server) or on cloud (another Salesforce org).

It was earlier called as Lightning Connect.

Uses concept called as External Objects which are similar to custom objects.

Based on OData (Open Data Protocol) which is a modern, REST-based protocol for integrating data.

Salesforce is running Salesforce DX Challenge on twitter. Anyone can participate in this challenge. It is a 5 day program starting from 18th September and it ends on 22nd September. In this challenge you need to complete and earn "App Development with Salesforce DX" badge on Trailhead. After completing all the steps of this module you need to take the screenshot of final “Woohoo!” screen and tweet the image with text "Game over! I completed the #DontStopDeploying Challenge!".
After tweeting, you need to fill up a form located at http://go.pardot.com/l/27572/2017-09-15/7lqdqs
In this form, you need to enter your name, address, link to your Trialhead profile and link to the tweet that you tweeted. If you are one of the first 1000 person to complete this, you will win goodies from Salesforce.

More details are available at https://developer.salesforce.com/blogs/2017/09/earn-swag-dontstopdeploying.html

Here is the twitter link to the hashtag https://twitter.com/search?q=%23DontStopDeploying&src=tyah and youtube video of the competition

https://www.youtube.com/watch?v=M2awPf3yugg&feature=youtu.be

So, don't wait, just get the badge and win some goodies from Salesforce.

Monday, September 18, 2017

Salesforce.com also know as SF or SFDC is a cloud computing company located in USA. It was founded by Marc Benioff in 1999.

Salesforce provides customer relationship management software built on its platform. Using this, customers can manage acquisitation of potential customers and provide servies and support to existing customers.

It provides several applications built on top of Salesforce Platform like Sales Cloud ( for selling your products to customers), Service Cloud ( for providing service), Health Cloud ( Product built specifically for HealthCare companies), Finance Cloud ( Product built for Finance domain companies), Analytic Cloud (for Analyzing data. There are several other products.

There is no need to install any new software on your machine to access Salesforce.

All the data and application resides on Salesforce server.

You can access your application using a standard web browser like Google Chrome, Mozilla Firefox or Internet Explorer. Since these browser are available on Windows, Ubuntu, Android and Mac OS there is no dependency on OS as well.

You also do not have to maintain the application as it is maintained by Salesforce. Any new updated released by Salesforce will also be applicable to your application

5. What is a Lead?

A sales lead is a prospective consumer of a product or service, created when an individual or business shows interest and provides contact information.

In this post, we will see how to install Visual Studio Code (vscode) and install Saleforce DX CLI (SFDX CLI) as an extension in vscode text editor .Salesforce DX Development team has added Syntax highlighting for Apex, Visualforce and Lightning bundle files. Auto complete feature is provided for Apex code, which is based on Apex Language Server.

Salesforce DX is now generally available. Visual Studio code is now officially supported with Salesforce DX instead of Force.com IDE which is not very surprising as it is very challenging to work with the Force.com IDE.

VS code uses Java and a jar file under the hood to provide syntax highlighting and auto completion. So we need to install latest version of Java first.

You also need SFDX CLI installed on your machine to use the Salesforce DX features in VSCode IDE.

Install JDK from Oracle Website and set the JAVA_HOME environment variable.

Download and install vscode from https://code.visualstudio.com/download. The extension name is
"Visual Studio Code Extension Pack for Salesforce DX"

Visual Studio Code Extension can be downloaded from
https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode.

If you have already installed the extension and are facing issue like the command not appearing in the command pallete, uninstall the extension and try reinstalling those.