COSWorkBalancesRecalcAll Class [AX 2012]
The COSWorkBalancesRecalcAll class summarizes work account values from a transaction into period balances during each written operation on work transactions.
| Method | Description | |
|---|---|---|
| cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) |
| deleteBal | Removes all costing balances in a fiscal year. (Overrides the deleteBal Method.) |
| deleteBalances | (Inherited from COSCostBalancesRecalcAll.) |
| equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) |
| fiscalCalendarPeriod | Finds the record of the FiscalCalendarPeriod table for the specified date in the fiscal calendar associated with the company information record. (Inherited from COSCostBalancesRecalcAll.) |
| getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) |
| handle | Retrieves the handle of the class of the object. (Inherited from Object.) |
| isBasePlan | (Inherited from COSCostBalancesRecalcAll.) |
| mustCalcWorkload | (Overrides the mustCalcWorkload Method.) |
| new | Initializes a new instance of the COSWorkBalancesRecalcAll class. (Overrides the new Method.) |
| notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) |
| notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) |
| objectOnServer | Determines whether the object is on a server. (Inherited from Object.) |
| owner | Returns the instance that owns the object. (Inherited from Object.) |
| parmCOSCalculationId | Gets or sets the COSCalculationId parameter. (Inherited from COSCostBalancesRecalcAll.) |
| parmCOSPlanModelId | Gets or sets the COSPlanModelId parameter. (Inherited from COSCostBalancesRecalcAll.) |
| planWorkLoad | (Inherited from COSCostBalancesRecalcAll.) |
| recalc | (Inherited from COSCostBalancesRecalcAll.) |
| recalcAll | Calculates all costing balances in a fiscal year. (Inherited from COSCostBalancesRecalcAll.) |
| recalcOffset | Recalculates and updates COSWorkOffset. |
| recalcPlanModel | (Inherited from COSCostBalancesRecalcAll.) |
| recalcStartDate | (Inherited from COSCostBalancesRecalcAll.) |
| recalcValueType | Calculates the costing balances in a fiscal year for a specified value type. (Overrides the recalcValueType Method.) |
| setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) |
| toString | Returns a string that represents the current object. (Inherited from Object.) |
| usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) |
| wait | Pauses a process. (Inherited from Object.) |
| workLoad | (Inherited from COSCostBalancesRecalcAll.) |
| xml | Returns an XML string that represents the current object. (Inherited from Object.) |
| ::construct | |
| ::newCalcPlan |
This class also recalculates work accounts balances.
There are three different types of transactions in cost accounting:
-
Current values are stored in the COSWortTrans table.
-
Budget values are stored in the COSWorkBudget table.
-
Plan values are stored in the COSPlanWorkTrans table.
The old balances should be deleted before balances are recalculated.
The following code example recalculates base plan costs for planmode 200502. This example will not compile in a job as it must be run in the context of a class, form, or other object.
static void example(COSFiscalYear _COSFiscalYear)
{
cosPlanTable cosPlanTable;
cosWorkBalancesRecalcAll cosWorkBalancesRecalcAll;
cosPlanTable = COSPlanTable::find("200502",_COSFiscalYear);
// Period values, no calculation set.
cosWorkBalancesRecalcAll =
COSWorkBalancesRecalcAll::newCalcPlan
("",cosPlanTable.PlanModelId);
cosWorkBalancesRecalcAll.deleteBal (
cosPlanTable.FiscalYear);
cosWorkBalancesRecalcAll.recalcValueType(
cosPlanTable.FiscalYear,
COSCostValueType::BasePlanCost);
}