You need to sign in to do that
Don't have an account?

addition of two fields using apex trigger?
Hi
I am new to development.
I have a custom object Add, contains three fields num1, num2, result.
i want to write a trigger for addition of num1 and num2.
when i enter num1 and num2 the result field will be automatically displyed.
Regards
Hi,
You can achieve this using Formula field which exacty suite for your requirment.
But if still you want to do this using trigger, find below code.
Here replace Customobject__c with your custom onject name.
All Answers
First make the class and add the calculation logic then make a trigger on your save or submit button. And then call that class in the trigger by using appropriate parameter.
Hi,
You can achieve this using Formula field which exacty suite for your requirment.
But if still you want to do this using trigger, find below code.
Here replace Customobject__c with your custom onject name.
Hi Dinesh,
Thankyou for your valuable infomation.
Regards