Accorto Projects maintains the current Costs, Revenue, and Expenses (updated immediately when some time or expenses are entered) - and actual Costs, Revenue, and Expenses (when approved).
For performance reasons, we suggest that "big projects" get the status of "NoActuals" - i.e. the information is not updated immediately. For bigger projects, also "up-to-day" (last night) information is often sufficient rather than "up-to-the-second". Also if you run reports summarizing TE Item data (rather than Project summaries), you will get current information.
The information can get out of sync when e.g. resource prices are changed. It may also not be accurate when time/expenses are allocated to projects but not to a Project Line.
To maintain accurate "up-to-the-second" project/line information, where the user can execute "Recalculate Actuals".
The link is available on Project and Project Line levels.
Also on Resource, you can start the update from the link Update T+E Item Prices, which gives you the option to Recalculate Items Only or Recalculate Items+Projects. (These options process immediately, so may fail due to Salesforce limits - use the batch options then)
Apex Batch
To automatically keep the values up-to-date, you can schedule Apex batches
> Setup > Apex Classes -- Schedule Apex
- TEPreBillingUpdate - this process updates the billing/cost rates on TE Items (usually not necessary if ProjectUpdate is scheduled)
- ProjectUpdate- this process is the same as "Recalculate Actuals" and updates project lines where there were items were entered or modified in the last 90 days
- it updates the rates on TE Items (same as TEPreBillingUpdate)
- creates/updates the "__project__" project line to catch the time/expenses which are not allocated to project lines
- updates the current/actual information on project lines (project-level information is rolled up)
Monitor the execution in > Setup > Apex Jobs
High Volume
If you have Project Lines with more than 20.000 TE Items, it is more efficient/faster to update the info via a nightly batch.
So in high volume environments:
- Set the Status of the Project (or Project Line) to "NoActuals" for projects with more than 20k TE Items (see tab Welcome - Status)
- Schedule to run the Apex job ProjectUpdate daily
Very High Volumes
If you have Project Lines with more than 50.000 TE Items, you may encounter Salesforce limit errors (50.001 records, 201/101 queries).
In Setup > Custom Settings -- Manage Accorto Settings, there are the following options to fine-tune the system:
- Project Update Batch Size - batch size for scheduled ProjectUpdate executions - default 20
- Project Update Batch Limit - default 10000, when the above batch size is set to 0, two batches are created - one for project lines with less than the limit of TE Items, another for Project Lines above the limit
Note that the ProjectUpdate process does not update the prices if it is certain, that a limit will be triggered.
So, in very high volume environments:
- Set the Status of the Project (or Project Line) to "NoActuals" for projects with more than 20k TE Items (see tab Welcome - Status)
- Schedule to run the Apex job TEPreBillingUpdate e.g. at 2am (as it may not be run by the ProjectUpdate job)
- Schedule to run the Apex job ProjectUpdate 1-2 hours later, e.g. 4am
- In Custom Settings - Manage Accorto Settings, set the "Project Update Batch Size" to 0
This will then start two batch jobs
- one for Project Lines with less than 10000 (Project Update Batch Limit) TE Items with a batch size of 20
- one for Project Lines with more than 10000 (Project Update Batch Limit) TE Items with a batch size of 1
Manual
You can start the Project update also manually in the Developer Console as an Administrator:
From the Setup (gear) icon menu - select Developer Console
Click on > Debug > Open Execute Anonymous Window
In the "Enter Apex Code" popup, enter
accorto.ProjectUpdate.startBatch(5, false);
The first parameter is the batch size, the second is only for projects/lines where the status is NoActuals.
You can check the log directly in the development console - or check the progress in
Setup > Apex Jobs
If you use dynamic forms, you cannot add the links to the layout. As a workaround, you need to add a text formula field to the Project object
HYPERLINK('/apex/accorto.ProjectRecalculateActualsStart?id=' + Id, 'Recalculate Actuals')