Pages

Wednesday, October 9, 2013

How to find what projects an object from the AOT exists in

Where I work, we are required to create a new, numbered project for every modification request.  The numbered projects have corresponding documentation for the intended purpose.

So when I later want to find out what projects an AOT object exists in, I needed a way to search inside every project.  I wrote this proof of concept job on how to find in what projects a specific object exists.  Enjoy!


static void FindWhatProjectsObjectExistsIn(Args _args)
{
    ProjectNode         pn;
    ProjectListNode     projectListNode;

    TreeNode            tn, tn2;
    TreeNodeIterator    tni, tni2;

    // Object we are searching for
    TreeNode            tnSearch = TreeNode::findNode(@'\Forms\SalesTable');
    ;

    projectListNode = SysTreeNode::getSharedProject();
    tni = projectListNode.AOTiterator();

    tn = tni.next();

    while (tn)
    {
        pn = tn; // ProjectNode inherits TreeNode
        pn = pn.loadForInspection();

        tni2 = pn.AOTiterator();

        tn2 = tni2.next();

        while (tn2)
        {
            if (tn2.treeNodePath() == tnSearch.treeNodePath())
                info(strfmt("Found in shared project %1", tn.AOTname()));

            // info(tn2.applObjectType()); // Returns the type (Form/Class/Table/Etc)
            // info(tn2.AOTname()); // Returns the object name
            // info(tn2.treeNodePath()); // Returns the object path
            
            tn2 = tni2.next();
        }

        tn = tni.next();
    }
}

7 comments:

  1. https://community.dynamics.com/ax/b/axaptavsme/archive/2013/03/03/how-to-find-your-object-in-aot-projects

    ReplyDelete
  2. How Can I get AOT Object name based on Label ID used?

    ReplyDelete
  3. Frustrating that there's no recursive iterator for nodes: the second iterator will only check objects at the root of shared projects, so if people organise their projects into groups, they'll be missed. Still, it's a starting point, so thanks for sharing.

    ReplyDelete
    Replies
    1. You're right. I wrote this ~4 years ago, but I should update it to use recursion and be more efficient. It's useful when I'm dropped into a new environment and I'm trying to figure out what 1 custom class does...I can track down the project it's in to find the related objects (if the developer had a heart to put it in a project!)

      Delete
  4. Witam, jestem nowy w hazardzie. Postanowiłem spróbować szczęścia. Może się okazać, że przyniesie to dobry zysk. Pieniądze są teraz bardzo potrzebne. Znalazłem w Internecie rekomendacje wielu kasyn online za darmo. Chcę powiedzieć, że to fajna praca https://fansportsklep.pl/ Vulkan Vegas . Mogę grać kiedy chcę i gdzie chcę. Ogromny wybór gier. Cieszę się, że wsparcie techniczne działa 24/7. Dla początkujących, takich jak ja, jest to świetne, ponieważ często pojawia się wiele pytań.

    ReplyDelete
  5. Рейтинг интернет-казино по выплатам возглавляют клубы, предлагающие контент с высоким RTP. Отдача игр добивается 98 процентов, среднее значение — 96 процентов. Коллекции клубов содержат модели с коэффициентами выплат до 10 000 кредитов. Благодаря бонусным настройкам приз может быть более. Некоторые эмуляторы топ онлайн казино шансы порадовать прогрессивным джекпотом. Каждая площадка проходит аудит, проверкой промышляют самостоятельные лаборатории. С отчетами можно ознакомиться, нажав на логотип проверяющей компании. Сообщается реальная отдача любой категории веселий. Аудит ведется месяц, можно оценить средний процент возврата.

    ReplyDelete