function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NikunjVadiNikunjVadi 

addition of one field of all child record under account

i need total time consumed for one customer , here account if parent object and time is child object. now there are multiple child record. child record have time_taken__c field .  i want to create a trigger that add all the time record data. .
PratikPratik (Salesforce Developers) 
Hi Nikunj,

Will you please elaborate on this requirement, it's little bit confusing. If you can provide the use case and details we will be able to help you out.

Thanks,
Pratik
NikunjVadiNikunjVadi
i am using this query . but it is giving me error 
Time__c tl = [select Time_Account_Mapping__c from Time__c order by LastModifiedById desc limit 1];
	
    integer x = [select sum(Hours__c) From Time__c where Time_Account_Mapping__c in  (select Time_Account_Mapping__c from Time__c order by LastModifiedById desc limit 1))];

Error : expecting a right parentheses, found 'order'

i am not able to solve this issue.