Container in dynamics ax

Description:-

In this article we will see about container. Here I have created Job to Dynamically set data in Container and read data from Container. Here I have used for loop to set data in container and when data load in container and after we want to display it on infolog for that I have create another for loop based on container length and get data from container. Here when we run we can little different data in container if we want some value and we don’t we want some data from container that we can set it in ax to get whatever we want from container. Here is the simple demo example to read and set data in container in ax.

Example:-

Static void Container_Check(Args _args)
{
  container daxConBeta;
  str charHolder = 'ume12sh';
  str 20 pa;
  real  r1 = 101200,r;
  real LengthCon;
  int i,j;
  ;
  for(i = 1; i<= 5; i++)
  {
    daxConBeta += str2con("Test");
    daxConBeta += str2con(int2str(i));
  }
  LengthCon = conLen(daxConBeta);
  for(i = 1; i<= LengthCon; i = i+2)
  {
    pa =conpeek(daxConBeta,i);
    info(strFmt("%1",pa));
    r=conPeek(daxConBeta,i+1);
    info(strFmt("%1",r));        
  }
  info(strFmt("Container Length - %1",LengthCon));
  info(strFmt("Container daxConBetaconPeek() values are :- %1, %2,%3,%4,%5,Length - %6", 
                conPeek(daxConBeta, 1),
                conPeek(daxConBeta, 2),
                conPeek(daxConBeta, 3),
                conPeek(daxConBeta, 4),
                conPeek(daxConBeta, 5),
                LengthCon));
}

Output:-



Related Posts

Previous
Next Post »

Thanks for comments.....