Doens.be

  • Linkedin flickr twitter delicious Facebook Youtube

Crap

Did you ever find any ‘personal’ comments from a Microsoft developer in AX code? I did. In AX2009 SP1 I found the following code block in the method displayComments() on the form HRMGoal:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public void displayComments()//HRMGoalComment _gc)
{
    Notes           note;
    HRMGoalComment  hrmGoalComment;
    boolean         firstTime = true;
    ;
 
    //Crap
 
    while select hrmGoalComment
        where hrmGoalComment.GoalId == hrmGoal.GoalId
    {
        if(note)
            note += '\n\n'; //changeLine;
 
        note += queryValue(hrmGoalComment.CreatedDateTime);
        note += ' ' + hrmGoalComment.employeeName();
        note += '\n' + hrmGoalComment.Comment;
    }
 
    displayComments.text(note);
 
}

Tags: , , , , ,

One Response to “Crap”

  1. June 17th, 2009 at 10:40

    Klaas Deforche says:

    Nice find Jeroen.
    It is crappy too, because it is best practice to put a space after the slashes, an never to put a comment line after your code, but on the line above! Not to mention the use of static text in the code and the missing brackets after the if.

Leave a Reply