DEV Community

Shubham Vaishnav
Shubham Vaishnav

Posted on

Salesforce Apex Trigger to Create a Simple Calculator

In this example, you will learn to create a simple calculator from a apex trigger in salesforce development.

Firstly we have to create an object of name " Calculater__c".

This apex trigger takes an picklist arithmetic operator " operator__c +, -, *, / and two fields operands " Value_1__c " and " Value_2__c " from the user. Then, it performs the calculation on the two operands depending upon the operator entered by the user.

Code :

Continue reading :- “ Salesforce Apex Trigger Program to Calculate Age from Birth Date in (Day, Month, Year) ”
https://salesforceforfresher.wordpress.com/2021/06/06/salesforce-apex-trigger-to-create-a-simple-calculator/

Top comments (1)

Collapse
 
kritikgarg profile image
kritikgarg

🙌 Thanks for sharing such an awesome post, Shubham! You demonstrating how to create a simple calculator using Apex Trigger in Salesforce is a great example of how triggers can be leveraged to automate tasks within the platform.
👍 It's great to see how easy it is to develop powerful functionalities with Salesforce's Apex language. Along with this, I also checked out the article on Triggers in Salesforce and found it to be the ultimate guide 👌 on triggers in Salesforce.