Share via


InventCostUpdate Class [AX 2012]

The InventCostUpdate class controls the global storage and final saving of the inventCostTrans and inventCostTransVariance records per dataAreaId.

Syntax

class InventCostUpdate

Run On

Server

Methods

  Method Description
Gg745648.protmethod(en-us,AX.60).gif addToMemory Adds the InventCostTrans records for a specified RecordSortedList object to the RecordSortedList object for this class.
Gg745648.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg745648.protmethod(en-us,AX.60).gif checkForPhysicalRecord Check to see whether a record in a different state exists for a given record.
Gg745648.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif finalizeCostTransVariance Processes the RecordSortedList object and InventCostTransVariance map that are handed over.
Gg745648.pubmethod(en-us,AX.60).gif getCostTrans Returns the record from the KeyCostTransMap map if found.
Gg745648.pubmethod(en-us,AX.60).gif getCostTransVarianceList Returns a RecordSortedList object with all the InventCostTransVariance records for a given InventCostTrans object.
Gg745648.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg745648.protmethod(en-us,AX.60).gif init Initialize the memory structures used in this class.
Gg745648.protmethod(en-us,AX.60).gif lockPrice Handles the locking of the InventItemPrice records to ensure that a new price is not entered.
Gg745648.protmethod(en-us,AX.60).gif new Creates a new instance of the InventCostUpdate class.
Gg745648.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg745648.protmethod(en-us,AX.60).gif reset Resets the class variables.
Gg745648.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif ttsNotifyAbort Calls the InventCostUpdate.reset method to reset all the variables.
Gg745648.pubmethod(en-us,AX.60).gif ttsNotifyPostBegin Calls the inventCostUpdate.reset method to reset all the variables.
Gg745648.pubmethod(en-us,AX.60).gif ttsNotifyPreCommit Updates the database by using the information that has been stored in memory.
Gg745648.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg745648.protmethod(en-us,AX.60).gif writeInventCostTrans Writes the costTransList recordSortedList to the database
Gg745648.protmethod(en-us,AX.60).gif writeInventCostTransVariance Writes all inventCostTransVariance records to the database
Gg745648.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg745648.pubmethod(en-us,AX.60).gif Gg745648.static(en-us,AX.60).gif ::construct Initializes a new instance of the InventCostUpdate class.

Top

Remarks

The InventCostUpdate class will be initialized for each dataAreaId through the InventCostUpdateGlobal class. This class will be used to store the inventCostTrans records and the inventCostTransVariance records in memory, and write them to the database when the final commit is called.

This class will be reset for each company when the first ttsbegin is called.

This class interacts with the inventCostMovement, the inventCostRevaluate and the inventCostAdjust classes.

Whenever all the costTrans records and the costTransVariances records in one of these two classes has been calculated completely, this class is called to push the variances of the structures to memory or to the database. This class communicates with the database to write the inventCostTrans and inventCostTransVariance records.

This class uses a key to identify which entries in the record sorted lists belong together. It is a composite key that consists of: InventTransId#Voucher#TransDate#CostTransType. This key stores a map that holds a recordSortedList of costTransVariance records (summarized for each key). Based on this information, at the final TTSCommit, this information will be used to assign the variances to each costTrans record after it is written to the database.

IMPORTANT: This class currently supports only two modes:

The first is the use from InventCostMovement or InvenCostRevaluate. A single call of the inventCostUpdate.finalizeCostTransVariance method is made for all the inventCostTrans records that belong together. This means that only new records are processed and none are updated.

Here are multiple inventCostTrans records processed at the same time.

Example InventCostMovement:

- init InventCostMovement

- add multiple InventTrans records to inventCostMovement

- finalize inventCostMovement

The finalize will call the invenCostUpdate.finalizeCostTransVariance method only once for all the inventCostTrans records that belong together.

The second mode is the use from InventCostAdjust. Multiple calls of the invenCostUpdate.finalzeCostTransVariance method are made for one inventCostTrans record. Here is only one inventCostTrans record processed at the same time.

Example:

- Process one inventTrans record belonging to one inventCostTrans record.

- Call the invenCostUpdate.finalizeCostTransVariance method.

- Process one inventTrans record that belongs to the same inventCostTrans record.

- Call the invenCostUpdate.finalizeCostTransVariance method again.

This class does not support situations where multiple inventCostTrans records are processed at the same time with multiple calls of the invenCostUpdate.finalzeCostTransVariance method.

Inheritance Hierarchy

Object Class
  InventCostUpdate Class