Share via


InventCostStop.unpack Method [AX 2012]

Unpacks what the RunBase.pack method packed.

Syntax

public boolean unpack(container packedClass)

Run On

Called

Parameters

  • packedClass
    Type: container
    The packed class in a container.

Return Value

Type: boolean
true if the container has been unpacked successfully; otherwise, false.

Remarks

When the RunBase.isSwappingPrompt method returns a value of true, you may have to unpack some prompt-related variables also.

Examples

This example demonstrates the use of the unpack method. However, it will not compile in a job as it must be run in the context of a class, form, or other object.

public boolean unpack(container packedClass) 
{ 
    Version version = runbase::getVersion(packedClass); 
 
  
    #localmacro.list1 // This is the first list 
        transDate 
    #endmacro 
  
    switch (version) 
    { 
        case #CurrentVersion: 
            [version,#CurrentList] = packedClass; 
            break; 
        case 1: 
            [version,#list1] = packedClass; 
        default: 
            return false; 
    } 
    return true; 
}

See Also

InventCostStop Class

RunBase.pack Method

RunBase.isSwappingPrompt Method

Pack-Unpack Design Pattern