Crap

  • June 16, 2009
  • 1 Comment

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 += 'nn'; //changeLine;
 
        note += queryValue(hrmGoalComment.CreatedDateTime);
        note += ' ' + hrmGoalComment.employeeName();
        note += 'n' + hrmGoalComment.Comment;
    }
 
    displayComments.text(note);
 
}
  1. Klaas Deforche left a comment on June 17, 2009 at 10:40 am

    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.

Comments are closed.