Sequence Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The Sequence class lets you perform transactions outside the main transaction scope, typically for some kind of sequence, or voucher number generation.
public ref class Sequence : Microsoft::Dynamics::Ax::Xpp::XppObjectBase
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
public class Sequence : Microsoft.Dynamics.Ax.Xpp.XppObjectBase
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
type Sequence = class
inherit XppObjectBase
Public Class Sequence
Inherits XppObjectBase
- Inheritance
- Attributes
Remarks
There are three kinds of connections: The main user connection, an auxiliary system connection, and user connections. The first is used for the application logic. The second is used for internal sequence number generation (specifically the built-in field RecId). The third is used for the application maintained separate connections. This class provides an interface to the auxiliary system connection for number generation. However, it may be a better solution to use the UserConnection class, as this is the method the application uses or flexibility, and to avoid concurrency problems with the kernel's sequence number generation.
The following example demonstrates the Sequence class.
static void example()
{
Sequence S = new Sequence("mySequence",1,100,10000);
print S.nextval(10); // 100 in current company (the subkey)
print S.nextval(10); // 110 in current company (the subkey)
print S.nextval(1,"MMM"); // 100 in subkey "MMM"
print S.nextval(1,"MMM"); // 101 in subkey "MMM"
}
Constructors
Sequence() | |
Sequence(IntPtr) | |
Sequence(String, Int32, Int64, Int64, Boolean, Int64) | |
Sequence(String, Int32, Int64, Int64, Boolean) | |
Sequence(String, Int32, Int64, Int64) |
Fields
__k_SequenceId | |
kernelClass | (Inherited from XppObjectBase) |