TestSetup annotation – pros and cons

What is TestSetup Annotation

We all know that for most unit tests in Salesforce, we need to generate some test data. And for different test methods within one single test class, the required test data set is usually very close. In order to serve for this purpose, Salesforce has introduced TestSetup annotation. The data generated in TestSetup will be persisted for every test method within the test class to use. And the data will only be rolled back after the execution of the whole test class completes.

• • •

Convert Visualforce page into SLDS

In the past few weeks I have been working on converting our existing Visualforce pages into lightning experience look and feel. SLDS is cool, but since it doesn’t support <apex:xxx> tags at the moment, the conversion can be tough and tedious, especially when it comes to harder tags like <apex:inputField> for a lookup relationship or <apex:selectCheckboxes>.

• • •

3.4 Write a more difficult trigger

The scenario

In this scenario, we will capture how many overall revenue does a single merchandise capture. Suppose we are selling bicycles. The price of one bicycle is 100. And we have sold three bicycles in total. Then the total revenue should be 300.

• • •

What is view state in Visualforce

What is view state in Visualforce? In short, it makes Visualforce page appears stateful. If you were like me who were not very clear about the difference between stateful and stateless, you might feel similarly confused. What the hell does that mean?

• • •