Monday, 4 March 2013

Microsoft Dynamics AX 2012 R2 - conPoke Function

Modifies a container by replacing one or more of the existing elements.


  • container conPoke(container container, int start, anytype element, ...)


  • Parameter: container
  • Description: The container to modify.
  • Parameter: start
  • Description: The position of the first element to replace.
  • Parameter: element
  • Description: One or more elements to replace, separated by commas.

 The first element of the container is specified by the number 1.

Return Value

  • The new container with the new elements.


  • X++
static void conPokeExample(Args _arg)
    container c1 = ["item1", "item2", "item3"];
    container c2;
    int i;

    void conPrint(container c)
        for (i = 1 ; i <= conLen(c) ; i++)
            print conPeek(c, i);
    c2 = conPoke(c1, 2, "PokedItem");
    print "";

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

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

1 comment: