Remove breakpoint in X++ code

Removing the hardcoded breakpoint in Classes/Methods:

void breakpointRemoving(Args _args)
{
#AOT Name name;
NumberOf recordCount;
TreeNode treeNode,treeNode1;
SysDictClass sysDictClass;
str code;
str string;
TextBuffer textBuffer;
string = "breakpoint;";

textBuffer = new TextBuffer();

treeNode = TreeNode::findNode(#ClassesPath);
treeNode = treeNode.AOTfirstChild();

while(treeNode)
{
treeNode1 = treeNode;
//Class got selected
treeNode = treeNode.AOTfirstChild();

while (treeNode)
{
//Saving the code to str;
code = treeNode.AOTgetSource();

//Saving the code to textBuffer
textBuffer.setText(code);

if(textBuffer.find(string))
{
//Replacing the string with the one space
textBuffer.replace(string," ");

//Saving the updated code from textBuffer to treenode
treeNode.AOTsetSource(textBuffer.getText());

//Saving & Compiling the updated code from treenode to AOT
treeNode.AOTsave();
treeNode.AOTcompile();
}

//Saving the methods/class
treeNode1.AOTsave();

//Moving to next method
treeNode = treeNode.AOTnextSibling();
}

//Moving to next class
treeNode = treeNode1.AOTnextSibling();
}

}
Advertisements