Monday, 4 March 2013

Microsoft Dynamics AX 2012 R2 - conPeek Function

Retrieves a specific element from a container.


  • anytype conPeek(container container, int number)


  • Parameter: container
  • Description: The container to return an element from.
  • Parameter: number
  • Description: The position of the element to return. Specify 1 to get the first element.

The conPeek function automatically converts the peeked item into the expected return type. Strings can automatically be converted into integers and real numbers, and vice versa.

Return Value

  • The element in the container at the position specified by the number parameter.


  • X++
static void conPeekExample(Args _arg)
    container c;
    int i;

    c = conIns(["item1", "item2"], 1);
    for (i = 1 ; i <= conLen(c) ; i++)
        print conPeek(c, i);

My above blog is based on Microsoft's Official information.

I hope this blog about 'Microsoft Dynamics AX 2012 R2 - conPeek Function' was informative. Please feel free to leave your comments.

No comments:

Post a Comment