This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger Calculator on Calculater__c (before Insert, before update) { | |
for(Calculater__c s : trigger.new) | |
{ | |
if(trigger.isInsert || trigger.isUpdate) | |
{ | |
if(s.operator__c=='/') | |
{ | |
s.Result__c= s.Value_1__c / s.Value_2__c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger presentAge on Date_OF_Birth_Calculat__c (before Insert, before update) { | |
for(Date_OF_Birth_Calculat__c DOB : trigger.new) | |
{ | |
if(trigger.isInsert || trigger.isUpdate) | |
{ | |
integer[] month = new list <integer>{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | |
Date present_date = System.today(); | |
Integer present_Day = present_date.Day(); | |
Integer present_month = present_date.Month(); |