Apex Trigger in Salesforce

Apex Trigger in Salesforce

Are you looking for the best advice on Apex Triggers in Salesforce to derive more value out of your Salesforce products? If your answer is in the affirmative, this blog on Salesforce Apex Triggers.

Let us pursue this informative journey by understanding about Triggers.

What is a Trigger?

A trigger is an Apex script that executes before or after certain events occur in DML, For example, before the object record is entered into the database or after the record has been deleted. Triggers allow you to carry out custom actions before or after changes to Salesforce records. A trigger is Apex code that is executed before or after the following types of operations such as Insert, update, delete and delete. 

Two types of Apex triggers

Before trigger

This trigger is used to update or verify the value of a record before it is saved in a database.

After trigger

This trigger is used to access values of the record ​​stored in a database and use this value to make changes to other records. After trigger records are in read-only format.

Bulky Trigger

By default, all triggers in Salesforce are bulky triggers. This means you can process many records simultaneously. Bulky triggers can handle  bulk operations and single-record updates, such as the following:

  • Data import
  • Mass Fraction
  • Bulk API calls
  • The recursive apex methods

Trigger Syntax

 trigger myAccountTrigger on Account (before insert, before update) {



  1.  myAccountTrigger – triggerName ( It is the name you would want to give your trigger).
  2. Account – Objectname (It is the object on which the action needs to be performed).
  3. before insert, before update – Trigger_events

Before insert: When using this event, the code block gets executed before a new record is inserted.

Before update: When you use this event, the code will get executed before a new record is updated in the object.

Trigger Context Variables:


Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.


Returns true if this trigger was fired due to an insert operation


Returns true if this trigger was fired due to an update operation


Returns true if this trigger was fired due to a delete operation.


Returns true if this trigger was fired before any record was saved.


Returns true if this trigger was fired after all records were saved.


If a record is recovered from the recycle bin it returns trigger true.


Returns a list of the new versions of the sObject records. This sObject list is only available in insert, update, and undelete triggers, and the records can only be modified before triggers.


A map of IDs to the new versions of the sObject records. This map is only available in before update, after insert, after update, and after undelete triggers.


Returns a list of the old versions of the sObject records. This sObject list is only available in update and deletes triggers.


A map of IDs to the old versions of the sObject records. This map is only available in update and deletes triggers.


The total number of records in a trigger invocation.

Triggers in Salesforce vs. Workflow in Salesforce


  • It is an automated process that can shoot an action that is based on evaluation and rule criteria.
  • Performing DML operations in the workflow is not possible.
  • We can obtain a workflow over an object.
  • We can’t create a query from the database.


  • It is a piece of code which is executed either before or after a record is updated or inserted.
  • More than 15 DML operations can be used in a single trigger.
  • More than 20 SOQLs can be used from the database in a trigger.
  • We can access triggers across an object and related to that object.

Limitations of Workflows overcome by Triggers in Salesforce

  • Workflows are not able to create or update a separate object.
  • You can’t reference certain fields when using workflows.
  • You will not have your workflow doing more than just field updates and emails.


Triggers in Salesforce are called Apex Triggers. A trigger in Salesforce is an Apex code that is used to perform an operation before or after a record is operated.

Want to know more about triggers? Contact our certified Salesforce Consultants now!


Accessibility Mode in Salesforce

Accessibility Mode in Salesforce

Salesforce Web Accessibility ensures that people with disabilities can recognize, understand, navigate, interact, and contribute to the applications that are available to the world at large. This means the pages should be responsive, functional, understandable, and robust at the same time. It includes providing keyboard interactions alternatives for all mouse-based actions, correctly identifying all fields of forms and buttons, providing textual alternatives for all images, videos, icons, and SVG files, and creating components correctly to define their identities, operating models, and more.

Salesforce is committed to providing high-quality, on-demand enterprise applications that are accessible to all individuals, including users working with assistive devices, such as speech recognition software and screen readers.

What is Accessibility Mode in Salesforce?

Salesforce Accessibility Mode is a type of interface mode that is designed for voice recognition and screen reader software. By using this accessibility mode on Salesforce.com, you can make work easily and efficiently with Salesforce. Furthermore, you can create reports and dashboards with voice recording software in Accessibility Mode.

How to enable Accessibility Mode in Salesforce.com?

Follow these steps to enable Accessibility Mode in SFDC:

Step 1: Go to Your name>>My settings>>Display & Layout>>Accessibility.

Step 2: Click on Accessibility as shown above.

Step 3: Now you are redirected to a new page where you have to check Accessibility mode checkbox.

Step 4: Enable Accessibility mode checkbox and click on the Save button to save the settings.

Features of Accessibility Modes

  1. You can access setup pages through a  Setup link at the top of the page.
  1. The Dropdown menu contains a Go button that lets you navigate to the option you choose in the dropdown list.
  1. The menu button appears as a drop-down list with the “Go” button.
  1. Overlay pages are displayed as separate popup windows.
  1. HTML editors are replaced by text boxes. This text box only accepts HTML and does not recognize the plaintext entry. To separate content, you should use paragraphs or line-break HTML tags.
  1. While accessing a dashboard, the View Dashboard Auto-Complete filter is replaced with the standard drop-down menu.
  1. The Edit Columns link on the Manage Members page, accessible by Manage Members dropdown on a campaign detail page. The Edit Columns overlay is replaced by a standard setup page.
  1. Clicking a requested meeting in the Open Activities related list and in some, the list views doesn’t open the meeting detail page. Instead of this, a dialog opens that guides you to contact the meeting organizer for the requested meeting details. 
  1. The Turn My Email On the dropdown list on a Chatter group displays as a Chatter Email Settings link that opens your settings for receiving Chatter email.


In a nutshell, the Salesforce Accessibility Mode is a feature that provides support for specially challenged people like blind or visually impaired people. It allows them to read and interpret the provided information either by converting text to speech or vice versa.
Want to learn more about Accessibility mode in Salesforce, you can reach us out by sending an email to info@cloudanalogy.com. Our Salesforce Lightning experts are always there to assist you!

Angular vs. AngularJS: A Complete Comparison Guide

Angular vs. AngularJS: A Complete Comparison Guide

Undoubtedly, Angular is a well-known framework for building web applications among most of the front-end developers. 

AngularJS is an open-source JavaScript framework for developing front-end applications. Its subsequent versions were numbered from Angular 2 to Angular 8

AngularJS is a framework written in JavaScript to build single-page applications. This was the first framework that enabled the development of interactive engaging and user-friendly websites. This has led to the development of single-page applications that are very responsive and have an excellent and attractive user interface.

According to the 2018 StackOverflow Developer Survey, Angular is the second-most widely used technology in the frameworks, Libraries, and other technologies. In the survey, 36.9% of the engineers surveyed agreed to use AngularJS or Angular 2+ to create an amazing user interface. However, 46% of respondents said that Angular was one of the most dreaded frameworks. 

In this blog, we will compare both Angular and Angular JS that will help you understand the difference between them.

Whether you are a software developer who specializes in web development or an organization that wants to expand its presence by launching applications, this AngularJS vs. Angular battle might be of your interest. 

Let’s get started.

Angular vs. AngularJS: Major Differences


The AngularJS architecture is based on the Model View Controller (MVC) design. Models are the main components that define the application’s behavior and manage their data, logic, and rules. The display produces output based on information in the model. The controller receives input, converts it to a command, and sends commands to the model and view.

In contrast, components and directives form the building blocks of Angular. Components are no more than directives with predefined templates. They provide a modern application structure making it easier to create and manage larger applications.

AngularJS uses JavaScript. On the other hand, Angular 2 and its latest versions use TypeScript. TypeScript is a JavaScript superset and provides static typing during the development process. Static typing not only improves performance but also avoids many runtime issues, which were making AngularJS more difficult to use for larger and complex applications.

Dependency Injection (DI)

Both AngularJS and Angular use dependency injection but the way they perform actions are completely different from each other. In AngularJS, DI is incorporated into various link functions, controller functions, and directive definitions. Angular uses a hierarchical dependency injection system using declarations, constructor functions, and providers.

Angular CLI
Angular 2+ renders with its own command-line interface or the CLI. It is used to produce components, services, etc. and also complete projects quickly and effectively. By checking dynamic types and linking, you can easily produce different versions of the same project for different platforms. On the other hand, AngularJS does not have its own CLI.

Expression Syntax
When it comes to data binding, Angular is more spontaneous than AngularJS. AngularJS developers must use the correct directive for binding a property or an event. In the case of Angular, the language uses () for event binding and [] for property binding.

Angular is much faster than AngularJS. In fact, the developers say that if angular applications are built correctly they can be up to five times faster than AngularJS applications.

The two-way binding that makes AngularJS popular among web developers has proven to be unprofitable because more sophisticated applications are being developed using it. In order to ensure and implement two-way binding, AngularJS continues to check each scoped variable with its previous value using a digest cycle. The execution of this digest cycle is random and therefore validation can continue indefinitely with increasing program size and hence affecting application performance.

In contrast, Angular has an optimized architecture that detects changes from unidirectional data flow that makes applications run faster.

Mobile Support
AngularJS does not support mobile development, but Angular does.

Advantages and Disadvantages

Advantages of Angular

  • Angular is up to five times faster than AngularJS because the data binding algorithm and component-based architecture are much better.
  • The Angular application components are independent and self-sufficient that makes them reusable. The independent components are easier to replace, maintain, and measure.
  • Angular applications can be rendered on browsers and mobile devices.
  • Angular has a default extension for rendering server-side applications. This allows developers to synchronize client and server sides.
  • Angular supports delayed loading, which makes the applications run faster because only the required components are loaded.

Disadvantages of Angular 

  • The learning curve of Angular is very high because you also have to master TypeScript. 
  • With the emergence of a framework that allows rapid development, many developers are not compatible with statically typed languages.
  • As Angular 2 was completely rewritten from AngularJS, the legacy system developed with AngularJS needed to be migrated that is something many developers dislike.
  • Angular is sometimes known as the verbose language because the components are managed in a very complex way.

    Advantages of AngularJS









  • Based on JavaScript, AngularJS is much easier and faster to learn.
  • AngularJS bi-directional data binding facilitates enables faster and easier data binding without developer intervention.
  • AngularJS supports faster coding and prototyping, significantly decreasing development time.
  • The AngularJS MVC and MVVM architecture separate design data from the design that makes the development and maintenance of complex web applications easier.
  • Clean and organized coding makes AngularJS code reusable.


Disadvantages of  AngularJS

  • If JavaScript is disabled on the system where you want to run the AngularJS application, the application will not run on it.
  • The developer must be familiar with MVC architecture to use AngularJS.


When Angular JS was launched, it gained much popularity among web developers because of its built-in features such as two-way binding, the ability to develop responsive web applications, and responsive design. However, its disadvantages were highlighted when other front-end development frameworks such as ReactJS were introduced and offered better performance. AngularJS has been rewritten in newer version Angular 2 to provide a better alternative for web developers.

Now, Angular offers the best alternative for building large and complex applications. The development team at Google is working to reduce the size of the Angular applications and improve their performance.

If you want to build a fairly simple and straightforward application, AngularJS can make development faster and easier. But if you are looking to develop complex applications that must be scalable, Angular should be your clear choice.

Considering that AngularJS is the framework for the future, you can hire certified AngularJS developers to make your work easier and faster. 

How To Use MuleSoft and Service Cloud To Create A Single Customer View?

How To Use MuleSoft and Service Cloud To Create A Single Customer View?

Did you know that as many as 69 percent of service leaders believe that a single customer view offers more upsell and cross-sell opportunities? That’s absolutely right – customer service as a revenue generator. However, 70 percent of service agents are unable to find all the information they require to perform their job on a single screen.

Without real-time insights and a single customer view, enterprises fail to cope up with when it comes to delivering the quality experiences that customers are looking for today. Therefore, integration to third-party applications and systems assumes paramount importance as a way to differentiate your service and attain a holistic view of your customers like your enterprise requires.

What Is A Single Customer View?

A single customer view means that your enterprise has a complete picture of the customer across and through every channel. In addition to this, customer data is aggregated and presented in a way that is both actionable and accessible to the wider enterprise, irrespective of where the data resides.

With a single customer view, your service reps and enterprise can:

  1. Be more proactive and personalized with their service.
  2. Engage with the target audience on their preferred channel.
  3. Answer questions and provide solutions effectively to promote faster issue-to-resolution.

We all know that service reps need to be empowered with the right information at the right time to provide the level of exemplary service that today’s demanding and tech-savvy customers expect.

Why Is This So Difficult To Achieve?

Generally, the data required about the customer is stored in different systems that make it difficult for enterprises to achieve a single customer view. Applications and systems are also usually connected using custom code, which inherently makes the infrastructure difficult and rigid to adapt to change. 

It is worthwhile to note here that it is impossible to create a single view of customers within a single screen without integration to critical systems like on-premises and Enterprise resource planning (ERP) databases. It means that service agent representatives have to swivel between different screens to even get access to simple customer information that leads to a disjointed digital experience for the customer on hold and unproductive experience for the agent who is spending more time on the manual processes.

Information is required to be brought in from systems like customer relationship management (CRM), ERP, financial suite, third-party database, predictive Artificial Intelligence, and chat for data to be aggregated into a single and unified platform. The key to a single customer view lies with integration and the ability to unlock siloed data in easily accessible ways.

The MuleSoft Anypoint Platform enables enterprises to synchronize data and automate transactions between ERP, Salesforce Service Cloud, and other third-party systems, whether in the cloud or on-premises. Customer service is powered and delivered by Service Cloud as it provides a unified workspace with the ability to have a comprehensive view of the customer within one console.

Together, MuleSoft and Service Cloud help enterprises achieve a single customer view by using MuleSoft to expose the critical customer data and surfacing it into Salesforce Service Cloud. The Mulesoft Anypoint Platform can be used by teams for creating API specifications using the API designer for specifying the third-party information they would like to expose and then proceed to create an API that would be then hosted and easy to discovered on the Exchange. 


Flow Designer, a web-based environment, then makes it easy to expose the required customer information using clicks not code, pulling it into Service Cloud. In doing so, your enterprise can leverage the different pre-built connectors and templates that are aimed to improve the speed of development and make Salesforce integrations an easy affair for your teams.

If you want to leverage MuleSoft and Service Cloud to create a single customer view, please feel happy to reach out to hire certified MuleSoft developers at Cloud Analogy, the best MuleSoft development company in the world.

Government Cloud Released By MuleSoft

Government Cloud Released By MuleSoft

MuleSoft has announced the release of its newest offering called the MuleSoft Government Cloud, a cloud deployment environment that seamlessly combines complete API management and Integration Platform as a Service (iPaaS) in a single runtime.

This product, configured within AWS GovCloud, would enable government agencies to develop, monitor, and manage all their application programming interfaces (APIs) and integrations from a single place. MuleSoft made this announcement after receiving a FedRAMP Authorization at the moderate impact level for August 2019. It is worthwhile to note here that seven of the 15 cabinet-level departments are already making the use of the MuleSoft Anypoint Platform.

Founded in 2006, MuleSoft provides a B2B application delivery network that connects devices, applications, and data with APIs. The software company headquartered in San Francisco has more than 900 customers in 60 countries and enables success-driven organizations through integration while also offering API connectivity to a comprehensive range of on-premises and cloud-based systems and applications.

MuleSoft Government Cloud, paired with the MuleSoft Anypoint Platform, allows IT teams to swiftly deploy sophisticated integrations, integrate on-premises apps with cloud services, and create new APIs on top of existing data sources. It is also designed to be scalable and available through zero downtime upgrades, intelligent healing, and redundancy. The FedRAMP Authorization offers the ability for sensitive data manipulation and adheres to security requirements like FIPS 140-2 compliant hardware and software encryption.

In a statement, MuleSoft Chief Product Officer Mark Dao remarked that the Government Cloud environment for Anypoint Platform is seamlessly engineered to assist agencies to allocate resources towards better citizen experiences by leveraging the potential of an application network to accelerate IT productivity and minimize maintenance and infrastructure costs while adhering to FedRAMP compliance requirements.

Pin It on Pinterest