AX – D365FFO – Get all projects childs from a root Project

If you want to get all projct childs from a root project jus use ProjTable::getChildProjectsFromRootProject.

The method returns a List of ProjTable.

Here you can find an example on how to use it

        ProjId rootProj = projTable::getRootProjId(projId);
        List _projList = new List(Types::Record);

        List list = projTable::getChildProjectsFromRootProject(rootProj, _projList);

        Enumerator en;
        en = list.getEnumerator();
        boolean found = false;

        while (en.moveNext())
        {
            if(en.current() is ProjTable)
            {
                ProjTable projTable = en.current() as ProjTable;

                if (projParentId == projTable.ProjId)
                {
                    found = true;
                }
            } 
        }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s