I set a breakpoint using the code editor. The breakpoint is on a line of code following an 'IF ... THEN' statement as follows :
IF ("Item No." = 'XYZ') and ("Lot No." = 'ABC') THEN
BEGIN
MESSAGE("Item No.");
END;
The breakpoint is on the line
MESSAGE("Item No.");
I set the debugger to 'Active' but not 'Breakpoint on triggers'. When I run my application it stops on a line of code a few lines further on from where I set my breakpoint. If I try and remove the 'new' breakpoint in the debugger and replace it on the line of code I want it on, the editor beeps and refuses to let me do it, like it isnt a valid line of code.
It is as if the code, the breakpoints and the debugger are out of synch. in some way. Is there some way to resolve this ?
0
Answers
My Blog - nav.education
I have resolved this now by changing the code to
IF ("Item No." = 'XYZ') and ("Lot No." = 'ABC') THEN
BEGIN
MESSAGE("Item No.");
MESSAGE("Item No.");
MESSAGE("Item No.");
END;
and setting a breakpoint on each of the lines which say
MESSAGE("Item No.");
I just wondered if there was a proper solution.
Sometimes the problem with displaying breakpoint dot in wrong line is caused by commented lines of code somewhere above. Try to Remove them and see if the breakpoint works as expected. Another example is when you use construction like (two C/AL statements on the same line - which is actually your case) instead of I would suggest workaround like that: and setting breakpoint on the line with MESSAGE("Item No.");
Regards,
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I cant afford to spend any more time looking for a more satisfying solution.
sometimes when you set a breakpoint on debugger or in the Code editor a message is dispayed: "Breakpoint still exists" (or so).
All Breakpoints are stored in the table Breakpoint. To see the values of this table, you can create a form on this table.
regards
It's annoying, but eventually you will find the right line to set the breakpoint. It's just the way that it is, sometimes the breakpoint does not align exactly with the code. It has been like that at least since version 2.01 when I started working with Navision.
RIS Plus, LLC