Skip to main content

Notifications

Announcements

No record found.

Debugging a runnable class in Dynamics 365 for Operations - Through HitCount feature

Hi,

Hitcount feature of debugging helps us when we want to stop the execution at the breakpoint only after breakpoint hit(by cursor) is equal to/Is a multiple of/greater than equal to the value specified in the hitCount.

Please follow below steps to make much usage of this feature and screenshots are provided for every steps.

Step 1: Create a runnable class, I used following code which displays the names of customers(through while select loop).I also used a variable (namely) i and incremented it in the loop. 

1256.Code.JPG

Step 2: Placed break point on the infolog statement(as shown below). Right click on breakpoint and select options Conditions.

Conditions.JPG

Step 3: On clicking conditions button, under conditions group, select HitCount and specify value as 2(as shown below). Click on close button.

Count2.JPG

Step 4: After successfully providing the hitcount value, please check the plus sign on the breakpoint.

PlusSymbol.JPG

Step 5: Build the solution and start debugging(through Debug > Start debugging) to see the execution stops after looping the while loop twice. This can be confirmed by checking the value of variable i in the locals window(red color box) and two info messages in the infolog window.

HitCount.JPG

 Likewise, you can debug using hitcount feature.

Regards,

Chaitanya Golla

Comments

*This post is locked for comments