You need to sign in to do that
Don't have an account?
count time from different records.
Hi All,
I have one custome field i.e. Time__C. I need to count time from different records within the object. what we counted time will be store in another custom field i.e Toatal_Time__C.
For Example :
Record1 : Time__C=2 hours.
Record2 : Time__C=3 hours.
Record3 : Time__C=2 hours.
So, Total_Time=7 Hours.
Thanks in advance
Thulasi.
I have one custome field i.e. Time__C. I need to count time from different records within the object. what we counted time will be store in another custom field i.e Toatal_Time__C.
For Example :
Record1 : Time__C=2 hours.
Record2 : Time__C=3 hours.
Record3 : Time__C=2 hours.
So, Total_Time=7 Hours.
Thanks in advance
Thulasi.
We can achieve this using trigger, have a look on below trigger.
Trigger Mytrigger on Object(before insert,before update)
{
List<Object> objList = [seelct id,time__c from object] ;
Decimal totaltime =0;
for(object objtime : objList){
totaltime += objtime.time__c;
}
for( Object obj:Trigger .new ){
obj.total_time__c = totaltime;
}
}
Hooe this will be helpful
Thanks,
Shiva