You need to sign in to do that
Don't have an account?
sum of fee by using trigger
How to write a trigger to sum like
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
where Fee Paid Details is class object's field and remaning three like First Installment ,Second Installment , Paid Full Fee is Contact object's field..??
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
where Fee Paid Details is class object's field and remaning three like First Installment ,Second Installment , Paid Full Fee is Contact object's field..??
Is there any relationship between class object and contact object.
If there is a relationship. Which will be acting as a parent.
Also if contact is child and class is parent. Then you have to know which child sum amount should you populate. because a single parent can have multiple child.
Let us know further details.
Thanks !
On that case you want to sum all the vales.
Eg: Class A has two contacts like,
Contact A - first instl as 200 - second inst as 400 - paid full fee as 400;
Contact B - first Instl as 400 - second inst as 300 - paid full fee as 300;
ON this case you want to update class A's fee paid detail as 2000;
or want to pick the sum of any one contact. If you want to pick and one contact on what condition you want to select the contact.
Thanks!
hi saran
yes u r right, a class have multiple contact's.
and yes i want to sum all the vales.
but here one thing
Fee Paid Details =First Installment + Second Installment or if he/she paid one time full payment then add only Paid Full Fee
Hope this below code will solve your issue.
Let us know if you face any issues.
Thanks!!
thanks for ur code but i'm looking trigger for class object like
trigger updateFee on class__c (after insert) and here add all the First + Second fee or if one time Paid Full Fee then add full fee
suppose i have 4 classes then every class have Fee Detail field where auto populate value like
Fee Paid Details = First Installment + Second Installment or Paid Full Fee
class have only one field that is Fee Paid Details remaning Field is present in Contact object ..
It we write the trigger in the class Object then the trigger will work only when the class obj is created or udated.
But in our case we will be creating contact after the creation of the class object. So there is no use in writing trigger on class__c object.
Thanks!
ya u r right we can't write a triggng in class object ....Thanks
But then how can add the cource fee ..
like...
Contact and Class related to each other by lookup
in contact (fee detaile ) object there is four field they r Cource Fee(number) ,First Installment(Number) ,Second Installment(number) and Paid Full Fee(checkbox)
so now i want to add all fee Classwise for example if i have 2 classes then i want to know how much money paid and how much remaning ,..??
as i think
Free Paid = First Installment + Second Installment or if click on Paid full fee then select course Fee field value
i want classwise totail Paid Fee Amount