The CostSheetCache table which is used as a temp location for cost sheets to help generate prices is not cleared automatically in AX unless you tell it to. So it can become very large inside of your DB (sometimes 10-30GB+) There are two ways you can clear out this information properly to keep this table small in size.
1.) Manually trigger the clearing inside of AX (this is the only way I know how to do it via default AX)
Go to Production Control / Setup / Routes / Cost Groups Modify any record on this form and it will trigger the cleanup whenever you close the form.
2.) Create a job with the following code.
static void CostSheetCacheClear(Args _args)
{
//this will clear the table CostSheetCache
CostSheetFactory::construct().clearCachedData();
info("Cleared the table CostSheetCache");
}
This is the same code that gets triggered in step 1 and can be found on
\Tables\BOMCostGroup\insert(), update(), delete()
1.) Manually trigger the clearing inside of AX (this is the only way I know how to do it via default AX)
Go to Production Control / Setup / Routes / Cost Groups Modify any record on this form and it will trigger the cleanup whenever you close the form.
2.) Create a job with the following code.
static void CostSheetCacheClear(Args _args)
{
//this will clear the table CostSheetCache
CostSheetFactory::construct().clearCachedData();
info("Cleared the table CostSheetCache");
}
This is the same code that gets triggered in step 1 and can be found on
\Tables\BOMCostGroup\insert(), update(), delete()