Dynamics NAV 2013 Debugger


Dynamics NAV 2013 comes with a completely redesigned development experience. One of the nicest new features is the innovative debugger. When I was looking for information that covered the new debugger, I found a lot of small articles that simply said it was more powerful and would debug any c/AL code. I wanted to understand it more, so I installed it to play with. I understand that not everyone has that luxury so I wanted to write a more in depth article to help you decide if it is truly worth looking at. Even if you are not a developer, this feature could prove valuable to you and should be considered when comparing new systems or when taking into account an upgrade proposition. The features in this debugger will drastically cut trouble shooting time and help to identify issues quickly.

The first indication of the power of the redesigned debugger is that it allows you to choose what session you would like to debug. This opens up the ability to debug any C-Side code anywhere in the application. This includes pages, reports, and xml ports and gives you the ability to debug objects running under any user (including the application server). If that doesn’t excite you enough, check out the walk through of this fantastic tool and see what it can do.

Open Microsoft Dynamics NAV 2013 Development Environment

Open a database by using the File -> Database -> Open option

From there click on Tools -> Debugger -> Debug Session or click Shift+Cntl+F11

This will bring up the Session List window shown below.

Session

clip_image002

All sessions attached to the chosen database are shown in the session list [Session.1]. If you choose a session and click the Debug option [Session.2] or press Cntrl+Shift+S a debug session window will come up waiting for an action from that session. Without even starting to debug a session, you can get critical information about the sessions that are attached to a db such as:

· the user id attached to the session

· what type of client they are attaching with

· what server they are coming from [Session 4]

· if they are currently being Debugged [Session 5]

· if they have been Debugged [Session 6] while this session of the Debugger has been open

· if SQL Tracing is enabled [Session 8] (SQL Tracing is covered at the end of this post).

Debugger

clip_image004

If there was already a break point set, the user could not just move through the code until they hit the break point.

The options shown in [Debugger 2] are to step into, step over, and step out all pertain to functions that you are currently in when sitting on a line. They are pretty standard with any debugger and not new to the debugger in 2013.

The same goes for the options in [Debugger 3]. Continue starts the code and continues to the next break. Break will stop the code at the next statement and is good to turn on when you are sitting in a position on a page and just want to know clip_image006the first thing to run when you start and action. Stop, stops the entire debugging session.

This brings us to the options in [Debugger 4]. Toggle is common and will toggle a break point when you are sitting on that line in the code window. This is also accomplished with F9. Set/Clear Condition is a bit more exciting. When you are on a break point and click it you will see the window to the right. It allows you to put in an expression to be evaluated and decide if the code breaks there or not. If a break point has a condition set, it will display a plus inside the circle clip_image008

clip_image010

In addition to any break points that are set, Break Rules [third option in Debugger.4] are additional options for when to break in code. The rules are Break On Error, Break On Record Changes, and there is a checkbox to indicate if you want to debug codeunit 1 or not.

Skipping codeunit 1 is important when walking through code. It prevents you from having to run through all the system and change log checks so you can simply step through the code block you are concerned with.

The next option in [Debugger 4] does exactly what it says, it disables all the current breakpoints you have set. An easy button when you want to continue to the end but you do want all the code to execute so you don’t want to cancel your debugging session.

clip_image012

The final option in the [Debugger 4] set of options is the ability to show a full list of all breakpoints currently set. This is done with the Break point list (Shown to the right). The options are self-explanatory and all do exactly what they say. This is a very nice feature to be able to manage all of your break points and enable/disable different ones with each run through the code. Just the ability to see them all in one single list makes debugging much more transparent and straight forward. No longer do you need to run the code to a break point then disable it when you do not think you need it for this run. In addition, if you do happen to know the object and line number you wish to set a breakpoint on, you can also add a new break point within this list.

So that takes care of our debugging options when we know the session we want to debug but what happens when we need to debug a web service call into NAV or a NAS session? Well, that is where [Session 3] option comes into play. It says debug next and it is used to debug the next session that comes on line. So if you want to debug a Web Service call, you will need to find a time when you can isolate the calls in and then turn this on, start your web service call and it should be the session caught. Same for NAS or any application that uses session start, just isolate the db, then start the service or process and capture the next session that appears.

This brings us to the last option we will discuss in this article. Full SQL Trace [Session 7 and 8]. SQL profiler is something I have used a lot of since I started with NAV. Generally to understand permissions but occasionally, it has been instrumental in solving issues. However useful, it has also always been a little frustrating because of the amount of obfuscated code. When used with Profiler, the Enable Full SQL Trace button at the top coupled with the corresponding check mark on each session you want to trace. There is a great article on how to do this on the Dynamics NAV team blog here http://blogs.msdn.com/b/nav/archive/2012/09/18/example-of-how-to-use-sql-tracing-feature-to-profile-al-code.aspx

author: T | Posted On Sunday, April 21, 2013 8:15 PM | Comments (0)

Inaugural Cowtown Code Camp is a huge success


With 25 development sessions over the course of the day, participants joined together to learn from leading industry experts and share professional discourse in a number of areas. With session tracks on Architecture, Game, Mobile, Web and Windows 8, the Cowtown Code Camp sessions covered a wide range of topics that are pertinent in today’s technical world. From talks dedicated to leveraging new API’s for easier development, to creating next generation mobile apps, Cowtown Code Camp offered something for everyone. Microsoft also hosted a Lounge area, where they answered developer questions about the Microsoft Stack and the Window’s Store, and demonstrated development for Windows 8.

Read more….

author: T | Posted On Friday, April 19, 2013 12:14 PM | Comments (0)

Microsoft’s Most Valuable Professional (MVP) Award Given to Manager at Professional Services Firm Rand Group


Each year, Microsoft awards an elite group of technical professionals who have demonstrated leadership in the community with the Most Valuable Professional Award. Recently Teresa Burger, Manager at Rand Group, received this prestigious award for her ongoing contributions to the technical community, and her acumen with the Expression Blend product.

Read more…

author: T | Posted On Thursday, March 14, 2013 4:35 AM | Comments (0)

Cowtown Code Camp


Pier 1 Imports and the Fort Worth .net User’s Group have teamed up to create the first annual Cowtown Code Camp.  It will be held at the Pier 1 headquarters in downtown Fort Worth on March 16, 2013.  I am on the planning committee for this event and I can tell you that Pier 1 Imports has brought some interesting ideas to the table to make this a unique, exciting and memorable Code Camp.  In addition to being able to count on coming away with information that will help you do your job better, we hope to provide a pleasurable experience that makes you glad you spent your Saturday with community.  And that is what this event is all about community, technology, and you.

Speaker submission and registration are currently open at Cowtown Code Camp .  Speakers and sessions will be announced by February 3rd.  If you are interested in speaking, I encourage you to submit a talk idea by clicking on “Call for Speakers”.  If you would like to attend, I encourage you to register early and save the date.   Lunch and parking are free.

author: T | Posted On Sunday, January 13, 2013 5:17 PM | Comments (0)

Dallas Day of .NET


RIA Consulting, LLC is hosting the third annual Dallas Day of .NET at the Las Colinas Country Club in Irving Texas on February 8th and 9th 2013. This year brings several highlighted speakers including Scott Hunter and Richard Campbell. See the full list of speakers at http://www.dallasdayofdotnet.com/speakers.html.

I enjoy the Dallas Day of .NET for the great networking opportunities. I meet more local IT and Development managers at this event than I do at our other local events. It is great to be able to find out what they are looking for and what direction people are looking toward in the future. The sessions are filled with enthusiastic audiences and lead by great speakers . You should come out, say hello, and let me know what you learned that will make your job easier.

Discount Code “Teresa” will get you $40 off the ticket price! Hurry before it sells out (and that is not a gimmick, it does sell out).  www.dallasdayofdotnet.com

author: T | Posted On Sunday, January 13, 2013 4:57 PM | Comments (0)

WPF DataGrid using a DataGridTemplateColumn rather than a DataGridComboBoxColumn to show selected value at load


My problem was that using a DataGridComboBoxColumn I couldn’t get it to show the selected value when the DataGrid loaded.  Instead, the user would have to click in the cells and like magic, the current selected values would appear and it looked the way I wanted it to on load.

Here is what I had

<DataGridComboBoxColumn MinWidth="150" x:Name="crewColumn" Header="Crew" 
     ItemsSource="{Binding JobEdit.Crews, Source={StaticResource Locator}}"  
     DisplayMemberPath="Name" 
     SelectedItemBinding="{Binding JobEdit.SelectedCrew, Mode=TwoWay, Source={StaticResource Locator}}" 
 />

 

Here is what I changed it too.  This works great.  It displays the selected item when the DataGrid loads and shows the combo box when the user goes into edit mode.

 

                           <DataGridTemplateColumn Header="Crew" MinWidth="150">
                                       <DataGridTemplateColumn.CellTemplate>
                                           <DataTemplate>
                                                <TextBlock Text="{Binding Crew.Name}"></TextBlock>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                        <DataGridTemplateColumn.CellEditingTemplate>
                                            <DataTemplate>
                                                <ComboBox ItemsSource="{Binding JobEdit.Crews, Source={StaticResource Locator}}"  
                                                   DisplayMemberPath="Name" SelectedItem="{Binding JobEdit.SelectedCrew, Mode=TwoWay, 
                                                   Source={StaticResource Locator}}"></ComboBox>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellEditingTemplate>
                                    </DataGridTemplateColumn>

author: T | Posted On Wednesday, November 28, 2012 7:43 AM | Comments (0)

Expression Blend + Sketchflow Preview for Microsoft Visual Studio 2012


Expression Blend has released a preview version of Blend that addresses some of the missing features of the version of Expression Blend that ships with VS 2012.   Here is a download to the preview version that has a lot of the features that were missing in the shipped version.  My suggestion is that anyone that works with Xaml and VS 2012 download this version of Blend  http://www.microsoft.com/en-us/download/details.aspx?id=30702

author: T | Posted On Sunday, November 18, 2012 10:46 AM | Comments (0)

Dallas First Robotics Competition (FRC) 2012


Wow!  That is all I have to say after three fun filled days in a world that fed the geek, sparked the competitor, inspired the humanitarian, encouraged the inventor, and continuously warmed the heart in me. 

First Robotics FRC 2012

First Robotics is an amazing program that strives to inspire young people to get involved with science and technology.  To accomplish this goal, they team up young people with engineering minded mentors to create machines with a goal of competing both on the field and by creating team websites.   Microsoft is a Crown Supplier as well as a team and regional sponsor for First.

This years Dallas First Robotics Regionals featured two separate playing fields hosting 79 teams averaging  approx. 12 students each (between 8 – 20) and 4 – 6 mentors.  We had a goal of 150 volunteers per field and managed to get about 120 per field.  The volunteer ratio was tight but these are dedicated people and the event was a huge success. 

This is my third year with First and I was honored enough to serve the Dallas First Regionals as both a Web Site evaluator and as the East Field Volunteer Coordinator.  This was also the first year my daughter volunteered with me. 

My daughter and I both recognize how different the First program is from other team events.  The difference with First is that everyone is a first class citizen.  Teams have to cooperate as much as they compete.  They rely on each other for parts and expertise when things don’t work.  Even with a veracious competition, you still find a lot of cooperation and we never witnessed any belittling between teams or individuals.

First Robotics coined the term “Gracious Professionalism”.   It's a way of doing things that encourages high-quality work, emphasizes the value of others, and respects individuals and the community.1 I was introduced to this term as the Volunteer Coordinator when I was preparing the volunteer instructional speech.  Through the next few days, I discovered it is truly core to everything that First does. 

One of the ways First accomplishes Gracious Professionalism is by utilizing another term they came up with which is “CoopertitionTM”. At FIRST, CoopertitionTM is displaying unqualified kindness and respect in the face of fierce competition.1   One of the things I never liked about sports was the need to “destroy” the other team.  First has really found a way to integrate CoopertitionTM  into the rules so teams can be competitive and part of that competition rewards cooperation.

Oh and did I mention it has ROBOTS!!!  This year it had basket ball playing Kinect connected, remote controlled, robots!  There are not words for how exciting these games are.  You HAVE to check out this years game, Rebound Rumble (also shown above) or you can view live action on Dallas First Video .  There are also some images below.

As part of the Dallas First Regionals, I was awed by incredible students who teach as much as they learn, inventive and truly caring mentors that make mentoring look easy, and completely passionate and dedicated volunteers that bring meaning to giving all that you have and making events fun and safe for all. If you have any interest in innovation, robotics, or highly motivated students, I can’t recommend anything any higher than visiting a First Robotics event or better yet, get involved.  There is always room for more volunteers.

Whatever it is, these students get it and exemplify it and these mentors ooze with it.  I am glad that First supports these events so we can all learn and be inspired by these exceptional students and mentors.  I know that no matter how much I give, it will never compare to what I gain volunteering at First.  Even if you don’t have time to volunteer, you owe it to yourself to go check out one of these events.  See what the future holds, be inspired, be encouraged, take some knowledge, leave some knowledge and most of all, have FUN.  That is what First is all about and thanks to First, I get it.

 

 

1.  USFirst http://www.usfirst.org/aboutus/gracious-professionalism

author: T | Posted On Sunday, April 1, 2012 1:39 AM | Comments (0)

Flow Fields in Dynamics NAV


I don’t know the exact business reason but someone asked how to identify all sales shipping orders with any negative quantities on them.  They needed to print these separately from the shipments that only have all positive quantities.

Here is one way to solve this problem

In NAV, open Sales Shipment Header

clip_image001

Add a field of type Boolean (The field type should match the value you expect to return from the flow field method.  In this case we will use an exist so we expect a bool but we could have used a Sum, Average, Min, Max, Count, or a Lookup to return a value).

clip_image002

Define it as a flow field and click on the ellipse next to CalcFormula

clip_image003

clip_image004

Now [Has Negative Qty] is false if no negatives exist

clip_image006

And [Has Negative Qty] and true if a negative exist

clip_image007

So it is ready to be used as a filter on the report.

clip_image008

Don’t forget that if you are using it in code, you may need to CalcFields.

Hope that helps.  If you really can’t afford the field in your header, you can use code to check the lines for a negative value each time and use a skip or break function to skip that header record but it seems expensive to check them all if you only want a few to print.

Please let me know if you think of a better solution.

author: T | Posted On Friday, March 16, 2012 9:08 PM | Comments (2)

Dallas GiveCamp Oct 2011


74 Developers, 13 Charities helped, 0 slices of pizza served.

GiveCamp is a national organization to help people organize development events for charity.  Dallas GiveCamp is one of those events where Developers give back by building websites or solutions for charity.

This years Dallas GiveCamp was held at CTRECH Hilton.  With classrooms and whiteboards available to each charity group individually, we had the most hours worked on site that I have seen in past years.  Many people where here all night working on their Charities and second shifts showed up early.  The coffee was hot and Debbie kept a stocked kitchen open all weekend!! 

Some groups set up their own oasis complete with smoothie service

Oasis

Some groups hired armed guards to keep the bugs away

onguard

Some groups tapped into a little witchcraft with help from pigs and Indiana Jones

whitchcraft

Over all, it was a fantastic and very successful weekend that couldn’t have happened without the dedication of the volunteers, charities, sponsors and Shawn Weisfeld with UserGroup TV.

 

DallasGiveCamp

 

GiveCamp

workinghard
camp
PaladinNews

author: T | Posted On Sunday, October 23, 2011 12:28 PM | Comments (0)