3.2 Write your first trigger

The scenario

In this post we are going to cover a real scenario, for each merchandise record we have created, we will automatically calculate the discount price based on original price and discount type.

• • •

3.1 What is a trigger

The concept of trigger

So what is a trigger? In short, trigger is the some actions you want to perform when you insert/update/delete a record in Salesforce. Think about these scenarios:

• • •

How to convert apex:pageMessages to be slds style

The problem

If you haven’t done so already, now is the time to seriously think about converting your existing Visualforce pages into lightning. One of the issues I have encountered during the process is to convert <apex:pageMessages/> section into slds look and feel:

• • •

Use Asana to track tasks

Asana has introduced board view recently. It gives me the feeling that it almost becomes the task managing tool over its fellow competitors. Originally I was using Trello because of its wonderful personal Kanban view. And now Asana has got the same board view. Asana’s other advantages suddenly makes it the shining superior one.

• • •

2.5 Use aggregate statements

The concept

Aside from retrieving values from a specific field, SOQL can also retrieve values from the aggregated result. For example, we can retrieve how much does each customer spend on all the transaction he or she made. In order to do this, we need to utilise Group by and Having clause.

• • •