Any one could please explain me about pack(),unpack() methods and what is the difference.


There is a very good explanation on ‘Pack / Unpack design pattern’ in Developers guide.

Hi Harish,

I dnt Have Developers guide.

Hi Anish,

Do you have dynamicsAx ?.You can find developer guide (developer help) there.



HI Anish,

Take look into the developers help or this is the information given in Inside Microsoft Dynamics AX book, it may be useful for the understanding…

Many classes require the ability to serialize and deserialize themselves. Serialization is an
operation that extracts an object’s state into value-type data; deserialization creates an
instance from that data.
X++ classes implementing the Packable interface support serialization. The Packable interface
contains two methods: pack and unpack. The pack method returns a container with the
object’s state; the Unpack method takes a container as a parameter and sets the object’s
state accordingly. You should include a versioning number as the first entry in the container
to make the code resilient to old packed data stored in the database when the implementation