List element names in a given model

static void ListElementsInModel(Args _args)
    SysModelElement     sysModelElement;
    SysModelElementData sysModelElementData;
    UtilElementType     elementType = UtilElementType::SharedProject;
    ModelRecId          modelIdFrom = 1662;    // ModelId source, SysModelStore::getModelId("ModelName", "ModelPublisher")
    while select sysModelElement
        where sysModelElement.ElementType == elementType
            && !(sysModelElement.Name like "*K3*")
            join sysModelElementData
                where sysModelElementData.ModelElement  == sysModelElement.RecId
                    &&sysModelElementData.ModelId       == modelIdFrom


About is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags