Why to avoid using Workflow rule and Process Builder field update with Trigger

Consideration before using Trigger, Workflow and Process builder field update at same time in Salesforce

Workflow rule and Process builder are the tools because of which Salesforce Admins can perform so many tasks, which were only possible by writing Triggers. Before release of Process builder, if we wanted to perform field update on child records or post chatter messages or auto execute Visual Flow, Triggers were used by developers.

As a best practice in Salesforce, it is always suggested that we should prefer “point and clicks” over code. Indirectly, prefer Workflow rule or Process builder over Triggers.

Trigger Workflow and Process Builder in Salesforce
Trigger, Workflow and Process Builder in Salesforce

In this post, I will explain a scenario where above statement will not stand true. Continue reading “Why to avoid using Workflow rule and Process Builder field update with Trigger”

Change Style of Console.log debug statements in JavaScript

Applying css style to console.log statements in JavaScript

Most of web developers or Salesforce Lightning Component developers are working on JavaScript. If they run into any issue and in need of debugging mechanism then Console.log is always there to rescue. Imagine your application has many debug statements and some of them are very important for problem solving, wouldn’t it be nice, if those statements can stand out from others ?

Recently, I noticed something amazing in Facebook console when I pressed “Ctrl+Shift+J” (Developer tools) as shown in below image.

Changed Style of Console.log in Facebook
Changed Style of Console.log in Facebook

Continue reading “Change Style of Console.log debug statements in JavaScript”

Export Datasets in Salesforce Analytics Cloud – Video

Video tutorial showing steps to download existing Datasets from Salesforce Analytics Cloud

Once data is synced from various sources in Dataset, it is saved in proprietor format of Salesforce Wave Analytics Cloud and can be retrieved using “Salesforce Analytics Query Language (SAQL)“. I came across free utility “Analytics-Cloud-Dataset-Utils” which is listed on my favorite Salesforce tools entry.

Below video tutorial shows, how this tool can be used to extract Dataset from Salesforce Wave Analytics Cloud as a CSV file. Continue reading “Export Datasets in Salesforce Analytics Cloud – Video”

Resolve error while fetching project code in Force.com IDE

Resolve Force.com IDE error while fetching Salesforce project because of different version

While working on force.com IDE this week, I started getting below error

Unable to update project properties: Element {urn:partner.soap.sforce.com}returnFieldDataTypes invalid at this location

Eclipse Force.com IDE - MARS.1
Eclipse Force.com IDE – MARS.1

Continue reading “Resolve error while fetching project code in Force.com IDE”

Salesforce Wave Analytics Cloud – Compare and Data Table (Video)

This is a third video in “Salesforce Wave Analytics Cloud” series to get familiar with platform.

This video demonstrates below functionality of Analytics cloud

  1. Logarithmic Scale
  2. Export lens as an image
  3. Focus
  4. Using Data table
  5. Benefit of Compare table

Continue reading “Salesforce Wave Analytics Cloud – Compare and Data Table (Video)”

Salesforce Wave Analytics Cloud – Stacked Bar Chart Hands On (Video)

This is second video in series to learn and get familiar with “Salesforce Wave Analytics Cloud”.

This is first video to directly get hands-on wave platform after covering some of basics.

It shows how to use “Stacked Bar Chart” in lenses. Continue reading “Salesforce Wave Analytics Cloud – Stacked Bar Chart Hands On (Video)”

Salesforce Analytics Cloud Basics – Video

Salesforce Analytics Cloud is new Business Intelligence tool from Salesforce on Wave platform.

Salesforce Wave Analytics Cloud
Salesforce Wave Analytics Cloud

How Wave Works

We can import millions of data into wave from external systems like Salesforce, SAP, BOOMI, CSV, Informatica etc.

How Salesforce Wave works
How Salesforce Wave works

Imported data in Wave is known as Dataset. Multiple lenses can be created on those Datasets which could be used to create dashboards. Continue reading “Salesforce Analytics Cloud Basics – Video”

How to start career in Salesforce – applicable for Freshers as well

I was owner of one of Training institute in Nagpur (India) named “Shivasoft” for almost 3 years. This is the reason few of you know me as a “Shivasoft”, some of you know me by my previous twitter handler “@ilovenagpur” as well. I was lucky enough that I had many bright and hard working students. They were kind enough to share lots of stuff happening around and other problems. One of the major issue is getting job after graduation and even harder problem is when students does not get selected in “campus recruitment” drive. Freshers needs job and employer needs experience, if you are not coming from campus, this is catch 22 situation. As fresh graduates doesn’t get a job , they either go with MBA (MBA is prestigious course but CAT ranking plays a huge role), advance programming courses like SAP or Oracle by paying hefty amounts , post graduation in IT itself, BPO jobs or some other profession.

This post is solely my opinion where I think, you could overcome this situation. However please do not consider this as a base, take a judgement of your own.

Starting career in Salesforce
Starting career in Salesforce

Continue reading “How to start career in Salesforce – applicable for Freshers as well”

Using Test.loadData to import records with relationship

There are many resources and documents available around how to use Test.loadData to create test records in Apex class. As per best practice of writing Test classes in Apex, Its good idea to store master data (aka Seed, Reference data) in static resource and load it in Test classes using “Test.loadData” method. It will save lots of code around creating test records and at the same time easy to maintain. We can store records of Custom settings, standard or custom object which can be used frequently in our code. One of the best functionality to make writing Test classes more easier, As we don’t need to concentrate on writing code for creating data, time can be used to assert actual functionality.

Test.loadData and Static resource in Salesforce
Test.loadData and Static resource in Salesforce

So the question is, How can we load related records using Test.loaddata() method ? Simply by creating fake Salesforce Ids, that’s right !!! It is possible.

In this post, we will be loading two CSV files in static resource. One static resource file is used to create Account records and Other CSV will be used to create child contacts of Account. Continue reading “Using Test.loadData to import records with relationship”

Lightning Component for Wikipedia search

Initially I thought creating Wikipedia Search component will be straight forward. I can simply use AJAX request from Lightning component to get result from Wikipedia using its REST API. Soon, I discovered about “Content Security Policy” in Lightning components developer guide.

If we attempt to use AJAX or REST API in Lightning component then below error will be thrown

Uncaught error in markup://ui:keyup : caught Failed to execute ‘open’ on ‘XMLHttpRequest’: Refused to connect to ‘https://en.wikipedia.org/w/api.php?action=opensearch&search=jitendra&limit=10&namespace=0&format=jsonfm’ because it violates the document’s Content Security Policy.

So, other workaround I came up is by using Apex controller to create HttpRequest and return result as JSON to lightning component. Let’s do it

Salesforce Lightning Component for Wikipedia Search
Salesforce Lightning Component for Wikipedia Search

Continue reading “Lightning Component for Wikipedia search”