venerdì 20 novembre 2015

X++: Find a shared project by name

This code allow you to search a project by name

ProjectListNode projectListNode;
TreeNodeIterator treeNodeIterator;
TreeNode treeNode;
str projectName;
;

projectName = "*xxx*";
projectListNode = SysTreeNode::getSharedProject();
treeNodeIterator = projectListNode.AOTiterator();
treeNode = treeNodeIterator.next();
while(treeNode)
{
  if (treeNode.AOTname() like projectName)
    info(treeNode.AOTname());
  treeNode = treeNodeIterator.next();
}

mercoledì 11 novembre 2015

HOWTO: Turning off the Synchronize Database form on Dynamics AX 2012

It is possible that the Synchronize Database form is now showing up unexpectedly during some of your scripts, if so you can programmatically set it on or off using the SysSqlSync ShowSysSqlSync global cache setting, here is a job that will turn off the form and automatically synchronize:
static void ShowSysSqlSync(Args _args)
{
    SysGlobalCache gc;
    str owner = 'SysSqlSync';
    str key   = 'ShowSysSqlSync';
    boolean showEnabled = false; //set to true to enable.
    ;
    gc = appl.globalCache();
    gc.set(owner, key, showEnabled);
    info(strfmt('Show SqlSync: %1', gc.get(owner, key))); 
}

AX 2012: The request was aborted: Could not create SSL/TLS secure channel

The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...