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:

Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++

  Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...