In the following link you can see a video about Dynamics AX warehouse command centre on Microsoft Surface:
Click Here
Cool!
If you any questions or comments e-mail me on: mirko@mirkobonello.com
Very Curly Hairstyles
4 years ago
A blog offering various X++ code snippets and tips for Microsoft Dynamics AX
void exampleMethod()
{
SalesTable copySalesTable;
;
// copySalesTableRecId = 0
copySalesTable = SalesTable;
// copySalesTableRecId = 100
// do some processing
SalesTable_ds.executeQuery();
// SalesTable RecId now changed to 90
// copySalesTable RecId = 90 i.e. shallow copy
info(num2str(copySalesTable.RecId, -1, -1, -1, -1));
}
void exampleMethod()
{
  SalesTable copySalesTable;
  ;
  // copySalesTableRecId = 0
  copySalesTable.data(SalesTable);
  // copySalesTableRecId = 100
  // do some processing
  SalesTable_ds.executeQuery();
  // SalesTable RecId now changed to 90
  // copySalesTable RecId = 100 i.e. deep copy
  info(num2str(copySalesTable.RecId, -1, -1, -1, -1));
}
static void Job6(Args _args)
{
  SalesTable originalSalesTable,
      copySalesTable,
      copySalesTable2;
  ;
  select firstOnly originalSalesTable;
  copySalesTable = originalSalesTable;
  copySalesTable2.data(originalSalesTable);
  info (num2str(copySalesTable.RecId, -1, -1, -1, -1));
  info (num2str(copySalesTable2.RecId, -1, -1, -1, -1));
  // using .data() method to mimic change in datasource / deep copy
  originalSalesTable.data(SalesTable::find('01323_036'));
  // the rule I'm describing in this post does not work if I used the following:
  // uncomment the line below and comment the line above to test
  // originalSalesTable = SalesTable::find('01323_036');
  info (num2str(copySalesTable.RecId, -1, -1, -1, -1));
  info (num2str(copySalesTable2.RecId, -1, -1, -1, -1));
}
#DEFINE.AUTO('Auto')
#AOT
#PROPERTIES
#WinAPI // Used for regional settings
TreeNode treeNode;
Int decimalPlaces;
;
treeNode = infolog.findNode(#ExtendedDataTypesPath + '\\' + identifierstr(YourEDT));
if (findproperty(treeNode.AOTgetProperties(),#PropertyNoOfDecimals) == #AUTO)
{
  // get the number of decimals from the regional settings
  decimalPlaces = str2int((WinAPI::getLocaleInfo(#LOCALE_USER_DEFAULT,   #LOCALE_ICURRDIGITS)));
}
else
{
  // get the number of decimals set by the developer in the property inspector
  decimalPlaces = str2int(findproperty(treeNode.AOTgetProperties(),#PropertyNoOfDecimals));
}
info (int2str(decimalPlaces));
static void recordsExist(Args _args)
{
  SysDictTable dictTable;
  ;
  dictTable = new SysDictTable(tableName2Id('TableStringHere'));
  if (dictTable)
  {
    if (dictTable.recordCount() > 0)
      info ("This table has records.");
    else
      info ("No records");
  }
  else
    info ("Table does not exist");
}