You need to sign in to do that
Don't have an account?
Patrick8020
Created a custom field for a user which adds up total account hours
I have a field within each account called: Allocated_Hours__c . This is a forumla which basically works out the number of hours each account gets. Within the User area I then have a field which displays the number of hours a user has in there month. What I want to be able to do is:
Add up the total number of hours a user has for their accounts and subtract that against the number of hours they have.
For example:
Peter has 14 accounts at 10 hours each = 140 hours. He gets allocated 150 hours so therefore he has 10 hours spare.
Any help would be much appreciated.
http://www.anthonyvictorio.com/salesforce/roll-up-summary-trigger/
All Answers
1. If the totals do not need to be reflected instantly on User object then you can use Batch Apex with scheduling at intervals as you need OR
2. Add a trigger on the Account object after insert, update, delete, undelete. You will need to manually calculate the totals and update the relevant totals field on User object.
Thanks for your reply.
It doesn't have to be real time however I do not think updating manually would be effective. The thing that is annoying is that the Roll Up summary is not available through the user object. I just want to SUM the total number of hours a user has for an account
http://www.anthonyvictorio.com/salesforce/roll-up-summary-trigger/
Yes I agree. However I am really struggling to do this as I am not an advanced salesforce developer. Where would I edit these pieces of code - through the formula area or is it under an advanced dev bit ?
Or equally would you recommend I leave alone as it is complicated?
Thanks for your time in replying to this - I will mark your answer as complete.
Thanks