Wednesday, 5 February 2020

X++ Job to list all the elements which are not included in version control

 X++ Job to list all the elements which are not included in version control

static void listNonVersionControlled(Args _args)
{
    SysVersionControllable  controllable;
    SysModelElement         sme_root, sme;
    SysModelElementData     smeData;
    SysModelLayer           layer;   
   
    setPrefix('Not version controlled elements');
   
    while select sme_root
        order by elementType
        exists join sme
        exists join smeData
        exists join layer
         where sme.RootModelElement     == sme_root.RecId
            && sme.RecId                == smeData.ModelElement       
            && smeData.layer            == layer.RecId          
            && smeData.ModelId          == xInfo::getCurrentModelId()
            && layer.Layer              == currentAOLayer()
        {       
        controllable = SysTreeNode::newTreeNodePath(SysTreeNode::modelElement2Path(sme_root));       
       
        if (VersionControl.parmSysVersionControlSystem().allowCreate(controllable))
        {
            info(SysTreeNode::modelElement2Path(sme_root));
        }
    }
}

No comments:

How to Disable “Advanced Filter or Sort” and Enforce Custom Filters on Any D365FO Form

 In Dynamics 365 Finance and Operations, users can apply filters through the “Advanced filter or sort” feature found under the Options tab...