web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Remove Object from Project via X++ code

(0) ShareShare
ReportReport
Posted on by 15

Hi have tried to remove the object from project using ProjectNode.removefromproject() method but it's not working. any solutions ?

I have the same question (0)
  • Sathish Kumar.v Profile Picture
    15 on at

    delete option works but i need remove option

  • WillWU Profile Picture
    22,363 on at

    Hi Sathish Kumar.v,

    Did you debug your code?

    Please show us the complete codes if possible.

  • Sathish Kumar.v Profile Picture
    15 on at

    projName = "ProjectTest";
    projNode = sharedProjList.AOTfindChild(projName);
    projNodeLoad = projNode.loadForInspection();
    traverseProjectNodes(projNodeLoad);
    projNodeLoad.treeNodeRelease();

    // List contains all element path details

    en = myListString.getEnumerator();  
    while (en.moveNext())
    {

    treeNode = TreeNode::findNode(en.current());
    if(treeNode)
    {
    projectNode = infolog.projectRootNode();
    projectNode = projectNode.AOTfindChild("Shared");
    projectNode = projectNode.AOTfindChild(projName);
    projectNode.lockUpdate();
    projectNode.removeFromProject(treeNode);
    projectNode.unlockUpdate();
    projectNode.AOTsave();
    }
    }
    info("Completed");

  • WillWU Profile Picture
    22,363 on at

    Hi Sathish Kumar.v,

    I found the old thread. It seems that the removeFromProject() doesn't work.

    But you can try the way in the link provided by Martin.

    dynamicsuser.net/.../remove-an-object-from-a-given-project-group

  • Sathish Kumar.v Profile Picture
    15 on at

    HI Will,

       thanks for the response. i have seen the link workaround but no use

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans