Friday, November 13, 2009

Dynamics Confessor Blogspot: Dex.ini Switches Part 3

Here is some very useful info on the Dex.ini. Wish I had seen some of this at the GP Conference this last week. Thanks Leslie. Dynamics Confessor Blogspot: Dex.ini Switches Part 3

Friday, November 6, 2009

Getting ready to head out

So on Sunday I will be heading to Fargo, ND for the Microsoft Dynamics GP Technical Conference 2009. I am really hoping to pick up a lot of information while there. Guys like Mariano Gomez and David Musgrave will be there doing sessions. I'm also hoping to make some contacts there. So if you're there and see me, stop by and say hello.

My fear is that everything will be all about developing with Dexterity and not about the Visual Studio side of developing. If you search for Great Plains info on Google you will find lots of topics floating around, but most of it will be about Dexterity. It has really amazed me that Microsoft has not moved more towards an interface/API that utilizes .NET. Yes I am aware of eConnect and the webservices, but you are very limited on what you can do via these.

So after a talk with a co-worker I have come to the same conclusion he has - the old school consultants drive what is developed and why learn a new language when you make lots of money utilizing something you have already mastered. Now I know that this is not everyone, I believe it does include a majority of the GP Community. You can read about how people want to open up the community and get more information out there, but there's still very few fresh ideas to be found.

So then after thinking about it more, I realized that those of us who come from a development background and are having problems with developing things in GP are missing something very fundamental. That thing in my mind is the accounting background. In my career I have built many websites, windows apps, services, etc., but I can honestly say that none of the apps I have written have used accounting principles. Many of the legacy app devs I have talked with over my career have always hand built some sort of accounting system. Most modern apps you build in .NET do not take regular accounting principles, i.e. double entry system, into account. Consider the slow of shopping cart apps out there. None that I have built, modified or implemented ever took this into account.

IMHO I think that those on the in with GP take that knowledge of the accounting principles for granted and assume that the new devs should know that. The problem with that is, current devs usually work on many different systems. When I first started programming about 13 years ago, you usually were given an area to work in. If I was building apps in the manufacturing area, I would not be given a project in the accounting area. That was left to other devs.

Technology allows us to work on every aspect of a company's apps from the websites to windows apps and now GP. The technology we have now allows us to move across projects easier as most projects are integrated with another at some level. It's rare to have an application that is truly a stand-alone app. At least in each of the companies I have worked in.

So now I am charged with building live apps in GP, and find myself having to learn accounting along the way.  If you go read the forum posts on any GP related forum you will see that many others out ther are really struggling with the same issue - they don't understand the core processes behind the applications they are developing. Now don't get me wrong here, I know that there are those that will want you to write their app for them and figure if they just keep playing dumb you will write the code, but there are many of us out there that just want to know the concept and the only way we can understand it is seeing how it is done.

I learn by doing things. I did not finish college. I do not have a degree. I just picked up a computer and was able to figure out how it worked, by doing things with it. So hopefully when I come back to work after the conference I will have a better understanding of what concepts are needed to work in GP. Any help is appreciated. :-)

Wednesday, October 14, 2009

Ready...Set...Go

This is one of those posts that will be mostly for me, but if it helps anyone else out there, well great. At this point I am re-writing a web page that takes in an Excel spreadsheet and lets the user select which worksheet to process. Well the processing can be done between an old VB6 DLL, which is very slow, and a .NET 2.0 DLL. Now of course the .NET version is much faster, but by how much?

Well in my classic ASP days I would set a Date variable at the beginning and one at the end and find the difference between the two. However, .NET has this nice little feature in the SSystem.Diagnostics assembly that is called "Stopwatch". Once you instantiate the stopwatch you need to call the Start method at the beginning of your code and the Stop method at the end of your code. From there all you need to do is call for the Elapsed property and it will give you back a TimeSpan. So much easier than trying to calculate the difference between two dates.


Dim sw As New System.Diagnostics.Stopwatch
sw.Start()
'... Do some long code stuff here ...
sw.Stop()
Dim ts As TimeSpan = sw.Elapsed
lblErrorMessages.Text = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", sw.Elapsed.Hours, sw.Elapsed.Minutes, sw.Elapsed.Seconds, sw.Elapsed.Milliseconds / 10)

Wednesday, September 23, 2009

Multi-Browser/OS Testing

So Scott Hanselman has a post up today about "MultiBrowser or CrossBrowser Testing and deconstructing Microsoft Expression Web SuperPreview". He mentions BrowserShots, and the Virtual PC versions of Windows that you can download, but I think he missed on important one and that is from Adobe.

Adobe has one called, BrowserLab, and this will emulate multiple browsers, as well as multiple operating systems. I have not fully tested this site yet, but our graphic designer showed me this site and it seems to cover most if not all the browser bases.

One of the nicest features is the Onion Skin. This feature allows you to take two browser views and overlay them so that you can see where they differ. Wow, is all I have to say about this feature. Where was this when I was freelancing as a designer/dev? This is a must in any designer or developer's toolbox.

Stanley

Tuesday, September 22, 2009

Pet Peeve with Exceptions

Private Sub MyMethod()
    Try
        '...do something
    Catch ex As Exception
        Throw New Exception("MyMethod", ex)
    End Try
End Sub
The code above is a big pet peave of mine because with code like the above you end up having to dig down through multiple InnerException objects to find the right exception message.

Working with exceptions is a very easy task. Only catch an exception if you can do something about it. Re-thowing the exception is not doing something about it. Reporting the error via email, event viewer, etc., is also not doing something about the exception. All of this can be done at the form/view/page level of the application.

For instance, lets say your building a class:
Public Class Person
    Implements IDisposable

    Private m_FirstName As String = String.Empty
    Private m_LastName As String = String.Empty

    Public Property FirstName() As String
        Get
            Return m_FirstName
        End Get
        Set(ByVal value As String)
            m_FirstName = value
        End Set
    End Property

    Public Property LastName() As String
        Get
            Return m_LastName
        End Get
        Set(ByVal value As String)
            m_LastName= value
        End Set
    End Property

    Public Sub New()
    End Sub

   Public Function GetAddressByNameTheWrongWay(ByVal FirstName As String, ByVal LastName As String) As String
        Try
            '...do something and return
        Catch ex as Exception
            Throw New Exception("some dumb message here",ex)
        End Try
    End Sub

   Public Function GetAddressByNameTheRightWay(ByVal FirstName As String, ByVal LastName As String) As String
        '...do something and return
    End Sub
End Class

So now with that class we have two ways of capturing the exception in our page.

Partial Class Maintenance_IVANSAgentApplications
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objPerson As New Person
        'Lets call it the wrong way first.
        Response.Write(objPerson.GetAddressByNameTheWrongWay(txtFirstName.text, txtLastName.text))
        'Now lets call it the correct way.
        Try
            Response.Write(objPerson.GetAddressByNameTheWrongWay(txtFirstName.text, txtLastName.text))
        Catch ex as Exception
            Response.Write(ex.Message)
        End Try
    End Sub
End Class

Since we were not able to actually do anything about the error message then we let it bubble up to our page level and catch it there.

Something that you may have been able to catch in our Class Person, would be a database connection issue. Perhaps the database was not available we could put code in to try a different database or to keep trying for so many tries. Just make sure you limit the re-tries, so that you do not get a timeout on your page while waiting for a database to return data when it will never come back.

Stanley

Welcome

Welcome to my little place in Cyber Space. I plan on using this site to help with my writing skills as well as a place to hold information about my software writing. If you have constructive critisim about anything I write here please feel free to leave a comment. I am always open to constructive critisism. If you plan on just making yourself look cool in your own eyes and want to degrade me, then please just keep going to some place else on the web. I am not looking to be put down because you think your cool.

If you like what is here feel free to follow me on Twitter. In general my Twitter posts are about my day or replying to others I follow. I'm still getting into the social revolution on the web. Call me slow, but at least I am making a go of it.

At this point in my career I am working for an Insurance Processing company, writing software. I write using the .NET Framework, using VB. My major project right now, is re-writing our check writing software into Microsoft Dynamcis Great Plains. I use Visual Studio Tools for Microsoft Dynamics GP, along with Visual Studio 2005. The learning curve for GP is pretty high for me as I am not an accounting person and do not understand accounting beyond the very basiscs. So if you have a site that teaches you about accounting basics and more send me a link.

Thanks for stopping by.

Stanley