COSCostBalancesRecalcAll Class [AX 2012]
The COSCostBalancesRecalcAll class is used for summarizing the cost account values from a transaction into period balances.
| Method | Description | |
|---|---|---|
| cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) |
| deleteBal | Removes all costing balances in a fiscal year. |
| deleteBalances | |
| 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. |
| 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 | |
| mustCalcWorkload | |
| new | Initializes a new instance of the COSCostBalancesRecalcAll class. |
| 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. |
| parmCOSPlanModelId | Gets or sets the COSPlanModelId parameter. |
| planWorkLoad | |
| recalc | |
| recalcAll | Calculates all costing balances in a fiscal year. |
| recalcPlanModel | |
| recalcStartDate | |
| recalcValueType | Calculates costing balances in a fiscal year for a specified value type. |
| 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 | |
| xml | Returns an XML string that represents the current object. (Inherited from Object.) |
| ::construct | |
| ::newCalcPlan | |
| ::newEntryType | |
| ::recalculateCurrentCalendarBalances | Recalculates the cost and service balances that belong to the current fiscal calendar. |
The summary occurs during each write operation on costing transactions. The class can be used for the recalculation of cost account balances. There are three different types of transactions in cost accounting:
-
Current values are stored in the COSCostTrans table.
-
Budget values are stored in the COSCostBudget table.
-
Plan values are stored in the COSPlanCostTrans table.
The old balances should be deleted before the recalculation of balances.
This example demonstrates the use of the COSCostBalancesRecalcAll class. However, this example will not compile in a job as it must be compiled in the context of a class, form, or other object.
This following example recalculates base plan costs for planmode 200502.
static void example(COSFiscalYear _COSFiscalYear)
{
cosPlanTable cosPlanTable;
cosCostBalancesRecalcAll cosCostBalancesRecalcAll;
;
cosPlanTable = COSPlanTable::find("200502", _COSFiscalYear);
// Period values; no calculation set.
cosCostBalancesRecalcAll =
new COSCostBalancesRecalcAll("",
cosPlanTable.PlanModelId);
cosCostBalancesRecalcAll.deleteBalValueType(cosPlanTable.FiscalYear,
COSCostValueType::BasePlanCost);
cosCostBalancesRecalcAll.recalcValueType(cosPlanTable.FiscalYear,
COSCostValueType::BasePlanCost);
}