Click here to Skip to main content
15,847,903 members
Articles / Programming Languages / Visual Basic

Integrating Service Industry Resource Management with Microsoft Dynamics GP

10 Dec 2015CPOL4 min read 25.3K   1  
When it comes to Enterprise Resource Planning and Scheduling, packaged CRM and ERP solutions lack the visual and natural user interface for adeptly managing this critical aspect of Field Service and related business operations - this article introduces a strategy using Microsoft Dynamics GP...

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

Image 1


Microsoft Dynamics GP is the leading business management software solution for mid-market organizations, and provides robust functionality for accounting, financial management, distribution, purchasing, inventory control, manufacturing, project accounting, payroll and human resources.  However, resource management and logistics as well as service dispatch and scheduling are not readily available in Dynamics GP, never mind a natural user interface for visually planning and scheduling resources. PureLogic selected DBI Technologies' Solution Schedule .NET and Studio Controls .NET components to provide this essential functionality.


PureLogic, a Microsoft Partner with a long record of accomplishment developing and delivering custom and packaged solutions for the Microsoft Dynamics GP platform, was challenged to meet the needs of the service industry - and specifically a field service centric, visual planning and scheduling solution. After much debate and research,  PureLogic chose to embed their eService/360 product into Dynamics GP using the same Dexterity development system used by Microsoft to create Dynamics GP and along with DBI Technologies' Solution Schedule .NET and Studio Controls .NET components for the essential natural user interface and visual scheduling functionality.

How It Was Done

"We knew the type of interface and functionality we wanted for our customers…", said Jeffery Southworth, Director of Product Development at PureLogic. "… and were pleased that Microsoft’s Visual Studio Tools (VST) for Dynamics GP was available to help us take full advantage of DBI’s .NET components. Not only did DBI have exactly what we needed in the way of Resource Scheduling and Dispatch, we also found they had a comprehensive collection of data, presentation and general UI design controls, as well. After evaluating and stress testing their commercial controls, along with a few phone calls back and forth, we started to incorporate DBI's Solution Schedule .NET and Studio Controls .NET components into our project."

"I was very pleased with how fast we were able to implement these controls." continued Jeffery, "And we took full advantage of DBI's custom component services, which really jump-started our development process. Their consulting team really knew their stuff, and why wouldn’t they? They’ve been building commercial scheduling and UI / Data software for years. Within three weeks of committing to our approach, we had a fully functional drag and drop Service Dispatch and Scheduling application including bidirectional integration with our Service Order Processing module. We were amazed at how fast we were able to satisfy this complex requirement and still keep it intuitive and easy to use for our customers."

Image 2

"DBI Technologies' dbiList, dbiDate, and dbiSchedule controls offer an efficient way to present scheduled and unscheduled service orders to the dispatcher for sorting, selecting, scheduling, and unscheduling.

To schedule an order, the dispatcher uses the DBI Calendar control to select the schedule date, and then drags the unscheduled order from the dbiList to an available start time for an eligible Team Resource. The dispatcher can then increase or decrease the time period allocated to the order by simply resizing the timebar with the mouse. Using Microsoft VST for Dynamics GP, we were able to easily include the following code in the AfterTimeBarDrop() event of the dbiSchedule control to update the Team Resource, Arrival Date/Time, and Departure Date/Time on the underlying service order record in the Dynamics GP database."

Private  Sub DbiSchedule1_AfterTimeBarDrop(sender As System.Object, _
e As Dbi.WinControl.Schedule.AfterTimeBarDropEventArgs) Handles DbiSchedule1.AfterTimeBarDrop
        'Update team and arrival/departure date/time values
          SmServiceTrxHdrOpenTable.Key = 1
          SmServiceTrxHdrOpenTable.SmDocumentNumber.Value = e.TimeBarItem.Tag
          iTableError1 = SmServiceTrxHdrOpenTable.Change() 'Passive lock
        If iTableError1 = TableError.NoError Then
            EService360.Tables.SmServiceTrxHdrOpen.SmTeamItemNumber.Value = _
            			e.ScheduleItem.Tag 'Team Item Number
            EService360.Tables.SmServiceTrxHdrOpen.SmScheduledArrivalDate.Value = e.TimeBarItem.Start
            EService360.Tables.SmServiceTrxHdrOpen.SmScheduledArrivalTime.Value = e.TimeBarItem.Start
            EService360.Tables.SmServiceTrxHdrOpen.SmScheduledDepartureDate.Value = e.TimeBarItem.End
            EService360.Tables.SmServiceTrxHdrOpen.SmScheduledDepartureTime.Value = e.TimeBarItem.End
              iTableError1 = EService360.Tables.SmServiceTrxHdrOpen.Save()
            If iTableError1 = TableError.NoError Then
                	(Me.lstUnscheduledOrders.SelectedItems(0)) 'Selected item
                Select Case Me.lstScheduledOrders.SortColumn
                    Case 0 'Order Number
                    Case 1 'Name
                    Case 2 'Address
                End Select
                  sTimeBarTip = e.TimeBarItem.Text
                			("Error " + Str(iTableError1) + 
               ": Unable to save record in SM Service Trx Header Open table.")
                Exit Sub
            End If
            			("Error " + Str(iTableError1) + 
            ": Unable to lock record in SM Service Trx Header Open table.")
            Exit Sub
        End If
     End Sub
var i = 0;

"To unschedule an order, the dispatcher simply selects an order from the Scheduled Service Order dbiList and drags it into the Unscheduled Service Order dbiList. We were then able to include the following code in the lstUnscheduledOrders_DropList() event of the dbiList to remove the timebar from the dbiSchedule as well as the Team Resource, Arrival Date/Time and Departure Date/Time from the underlying service order in the Dynamics GP database."

 'Update arrival/departure date/time values
             EService360.Tables.SmServiceTrxHdrOpen.SmTeamItemNumber.Clear() 'Team Item Number
            iTableError1 =  EService360.Tables.SmServiceTrxHdrOpen.Save()
            If iTableError1 = TableError.NoError Then
                'Add the new node into the list
                 Me.lstUnscheduledOrders.Tag = Me.lstScheduledOrders.Tag
                Select Case Me.lstUnscheduledOrders.SortColumn
                    Case 0  'Order Number
                    Case 1  'Name
                    Case 2  'Address
                End Select
                 'Select unscheduled order
                For Each oNodeItem  In Me.lstUnscheduledOrders.Items
                    If oNodeItem.GetCellText(0) = Me.lstScheduledOrders.Tag Then
                        oNodeItem.Selected =  True
                         Me.lstUnscheduledOrders.EnsureVisible_(oNodeItem)  'ensure the selected item 
                         			'is visible in the control's viewing area
                        Exit For
                    End If
                 'Remove timebar from schedule
                Dim bExitAll  As Boolean
                For iTeamItem  As Integer = 0 To Me.DbiSchedule1.Items.Count - 1
                    For iTimeBarItem  As Integer = 0 To _
			Me.DbiSchedule1.Items(iTeamItem).TimeBars.Count - 1
                        If Me.DbiSchedule1.Items(iTeamItem).TimeBars_
                        	(iTimeBarItem).Tag = Me.lstUnscheduledOrders.Tag Then
                            Me.DbiSchedule1.Items(iTeamItem).TimeBars(iTimeBarItem).End =
                            	(iTimeBarItem).Start  'Workaround to clear RulerSelectColor
                            Me.DbiScheduleObject1.Start = Me.DbiDate1.Date.AddHours_
                            Me.DbiScheduleObject1.End = Me.DbiDate1.Date.AddDays(1)
                            bExitAll =  True
                            Exit For
                        End If
                    If bExitAll =  True Then
                        Exit For
                    End If
                 'Remove the original dbiNodeItem from the source dbiList control
                 	(Me.lstScheduledOrders.SelectedItems(0)) 'First selected item
                 'Unselect all timebar items
                For iTimeBarSelected  As Integer = 0 To DbiSchedule1.SelectedTimeBars.Count - 1
                     DbiSchedule1.SelectedTimeBars(iTimeBarSelected).IsSelected = False

"And finally, to create a seamless bidirectional integration between the Service Dispatch and Scheduling application and our Service Order Processing module, we added the following code to the TimeBarDoubleClick() event of the dbiSchedule control which automatically opens the Service Transaction Entry window and displays the specified Service Order below."

Private  Sub DbiSchedule1_TimeBarDoubleClick(sender As System.Object, _
		e As Dbi.WinControl.Schedule.TimeBarDoubleClickEventArgs) _
		Handles DbiSchedule1.TimeBarDoubleClick
        If cboBranch.SelectedIndex >= 0 Then
            If EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmBranchId.Value = _
            			cboBranch.SelectedItem And
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentType.Value = 2 And
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentNumber.Value = _
                				e.TimeBarItem.Tag And
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.DisplayExistingRecord.Value = _
                			True Then 'User is displaying this record
                EService360.Forms.SmServiceTrxEntry.Open() ' bring to front
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmBranchId.Value = _
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentType.Value = 2
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentNumber.Value = _
                EService360.Forms.SmServiceTrxEntry.Open() ' bring to front
            End If
        End If
     End Sub

Image 3

And vice versa, when the user clicks the above highlighted button on the Service Transaction Entry window in Dynamics GP, trigger logic automatically opens the Service Dispatch and Scheduling window and highlights the selected Service Order.

About the Authors


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Marketing DBI Technologies Inc.
Canada Canada
DBI Technologies Inc. is a commercial software development company focused on empowering application developers with the most flexible and respected, reusable commercial software components for Scheduling and Presentation layer application design. DBI is recognized for its award winning component products and its technical support for customers working in any Microsoft or .NET and OLE compliant development environments.

As an industry leader in the implementation of component-based application development, DBI provides creative solutions for its customers, incorporating current technologies built on commercially sound component-based architectures. DBI sets the standard for .NET and OLE compliant components. Built to rugged specifications and requirements, DBI components perform with precision and implementation ease in all compliant environments.

Comments and Discussions

-- There are no messages in this forum --