AxdStack Class [AX 2012]
The AxdStack class provides a stack that works on classes which inherit from the AxInternalBase class.
| Method | Description | |
|---|---|---|
| cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) |
| count | Returns the number of elements in the stack. |
| equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) |
| getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) |
| handle | Retrieves the handle of the class of the object. (Inherited from Object.) |
| new | Initializes a new instance of the AxdStack 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.) |
| pop | Pops the top AxBC object from the stack. |
| push | Pushes an AxBC object onto the stack. |
| setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) |
| top | Returns the top element in the stack. |
| 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.) |
| xml | Returns an XML string that represents the current object. (Inherited from Object.) |
This class is required when reading data from XML documents and when subsequently saving data as related tables.
Microsoft Dynamics AX document classes sometimes need contextual information so that they can update AxBC object data. The contextual information in this case is a stack of AxBC objects that are on the XML path and have already been saved, as well as the new AxBC object that has not been saved yet.
static void exampleMethod()
{
AxSalesTable axSalesTable;
AxSalesLine axSalesLine;
AxdStack axdStack = new axdStack();
axSalesTable = new AxSalesTable();
axdStack.push(axSalesTable);
axSalesLine = new AxSalesLine();
axdStack.push(axSalesLine);
info(strfmt("There are %1 object in the stack",axdStack.count()));
info(strfmt(
"The class in the first element in the stack has the id no. '%1'",
classidget(axdStack.top())));
axdStack.pop();
info(strfmt("There are %1 object in the stack",axdStack.count()));
}
Community Additions
ADD
Show: