Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Integrating Service Industry Resource Management with Microsoft Dynamics GP

10 Dec 2015 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.

Introduction

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.

Background

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."

"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.lstScheduledOrders.Items.Add(Me.lstUnscheduledOrders.SelectedItems(0).Text)
                Me.lstUnscheduledOrders.Items.Remove_
                	(Me.lstUnscheduledOrders.SelectedItems(0)) 'Selected item
                Select Case Me.lstScheduledOrders.SortColumn
                    Case 0 'Order Number
                        Me.lstScheduledOrders.Sort(0)
                    Case 1 'Name
                        Me.lstScheduledOrders.Sort(1)
                    Case 2 'Address
                        Me.lstScheduledOrders.Sort(2)
                End Select
                  sTimeBarTip = e.TimeBarItem.Text
            Else
                Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke_
                			("Error " + Str(iTableError1) + 
               ": Unable to save record in SM Service Trx Header Open table.")
                Exit Sub
            End If
        Else
            Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke_
            			("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
             EService360.Tables.SmServiceTrxHdrOpen.SmScheduledArrivalDate.Clear()
             EService360.Tables.SmServiceTrxHdrOpen.SmScheduledArrivalTime.Clear()
             EService360.Tables.SmServiceTrxHdrOpen.SmScheduledDepartureDate.Clear()
             EService360.Tables.SmServiceTrxHdrOpen.SmScheduledDepartureTime.Clear()
            iTableError1 =  EService360.Tables.SmServiceTrxHdrOpen.Save()
            If iTableError1 = TableError.NoError Then
                'Add the new node into the list
                 Me.lstUnscheduledOrders.Items.Add(Me.lstScheduledOrders.SelectedItems(0).Text)
                 Me.lstUnscheduledOrders.Tag = Me.lstScheduledOrders.Tag
                Select Case Me.lstUnscheduledOrders.SortColumn
                    Case 0  'Order Number
                         Me.lstUnscheduledOrders.Sort(0)
                    Case 1  'Name
                         Me.lstUnscheduledOrders.Sort(1)
                    Case 2  'Address
                         Me.lstUnscheduledOrders.Sort(2)
                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
                Next
  
                 '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 =
                            Me.DbiSchedule1.Items(iTeamItem).TimeBars_
                            	(iTimeBarItem).Start  'Workaround to clear RulerSelectColor
                            Me.DbiSchedule1.Items(iTeamItem).TimeBars.Remove_
                            	(Me.DbiSchedule1.Items(iTeamItem).TimeBars(iTimeBarItem))
                            Me.DbiScheduleObject1.Start = Me.DbiDate1.Date.AddHours_
                            	(Me.cboScheduleStartTime.SelectedIndex)
                            Me.DbiScheduleObject1.End = Me.DbiDate1.Date.AddDays(1)
                            bExitAll =  True
                            Exit For
                        End If
                    Next
                    If bExitAll =  True Then
                        Exit For
                    End If
                Next
  
                 'Remove the original dbiNodeItem from the source dbiList control
                 Me.lstScheduledOrders.Items.Remove_
                 	(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
                Next
//
//

"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
            Else
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.ClearButton.RunValidate()
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmBranchId.Value = _
				cboBranch.SelectedItem
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmBranchId.RunValidate()
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentType.Value = 2
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmDocumentNumber.Value = _
				e.TimeBarItem.Tag
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.DisplayExistingRecord.RunValidate()
                EService360.Forms.SmServiceTrxEntry.SmServiceTrxEntry.SmCustomerName.Focus()
                EService360.Forms.SmServiceTrxEntry.Open() ' bring to front
            End If
        End If
     End Sub
//
//

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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here