locked
Advice on factoring drive time for service activity RRS feed

  • Question

  • My company is using the service activity and calendar to route a crew to different sites.  However, I'm a bit frazzled as to how to account for driving time between service activities.  All of the service activities will have drive times between jobs, but not the last service activity for the day.  Where I'm struggling is how to find out what the next service activity so I can calculate the distance between and the drive time.  Does anyone have a pointer on where I could begin?  
    Tuesday, March 30, 2010 7:14 PM

Answers

  • Oh, I see... so you've already answered the problem of capturing travel time, you're just looking for a way to establish dynamic travel routes based on current location/next destination.  Well, you're going to need an set of address fields, or a reference to an address record somewhere.  How do you capture this information?  For my company, we collate all Service Activities into Cases which represent the entire service event.  On it, I have custom address fields to represent the location at which service is being performed.  Now, if I had a way of identifying the "next" Case based on the current one, I could programmatically feed both addresses into Google Maps' API and show a driving route in an Iframe... but where to put the Iframe?  Perhaps the Case isn't the best place for it, but maybe it is--I could see using the SiteMap to establish a new area on CRM that uses some Javascript and SOAP calls to provide the determination, and interaction with GMaps.  Either way the list of considerations boils down to:

    1.) Where do you store the addresses?

    2.) How do you identify the next service location in relation to the current/last one?

    3.) Where do you display the directions?


    Dave Berry
    Monday, April 5, 2010 3:46 PM
    Moderator

All replies

  • You probably print of an activity sheet for your crew right? Is this is order of the activities to be completed?

    If you ordered your activities by starttime (or similiar) and also apply a filter on the crew (Resource) you could then find the order in which activities occur and calculate your time.


    MSCRM Bing'd - http://bingsoft.wordpress.com
    Wednesday, March 31, 2010 8:37 AM
    Moderator
  • Hi Rhett,

    Ideally I was thinking I retrieve the scheduled service activity records and compare the schedule start dates to current time, then retrieve the location address and have that as part of the query string for a dynamic iframe to Gmaps or Virtual Earth.  Atleast, I know I can do the latter for the onload event on the service activity form.  And I've been trying to get up to speed on fetch, but have been just struggling on the grasp.  I've seen the simpler ones where I can execute a workflow but from fetching the records, I'm not sure how to then compare and find out which record would be the "one".

    Thursday, April 1, 2010 8:56 PM
  • PurvinP,

    That's exactly the situation we had here, and to solve it simply, I just created a new Service called "Travel".  Unfortunately, this results in recording a Service Activity for each "Travel" event before and after the standard "Service" event.  It's one of the reasons I created my Javascript Grid Editor utility, so that the engineers/technicians could quickly, and easily input their time without having to navigate and click all over the damn forms for records that really don't require them.  If you view the project, you'll see that the example pictures I include are of Service Activities specifically--that's not a coincidence.

    The nice thing about isolating travel into distinct Service Activity records, is that I can quantify and aggregate data for reporting purposes to identify them uniquely from other Services.  Until my JGE project, the significant downside was entering those records.  As they say, necessity is the mother of invention, and in this case it truly was.


    Dave Berry
    Friday, April 2, 2010 11:47 PM
    Moderator
  • Dave,

    I noticed that too when you first posted it.  This actually came of out of usage of your code.  I created a Time Travel Before duration field and one for after.   If the field attribute changes, I have a workflow that creates a regular appt that acts as the placeholder to the "travel time" and it updates if the duration is increased or decreased.  These fields we include for the master service activity so that the scheduler can account for that time before it is officially scheduled.  In our situation, the crew has no say so in scheduling aside from their workhours, and their schedule can be shifted the day of.  That's where the "we would like to have the directions to the next service activity on my schedule" part comes in. 

    I've considered getting location data from GLatitude services of where they are at so I could use that as the starting point and then using service activities location as the end.  OR I can some how programmatically figure out what the prior service activity was scheduled and use that.  That's where I got stuck as to how I would do that.

    Monday, April 5, 2010 7:23 AM
  • Oh, I see... so you've already answered the problem of capturing travel time, you're just looking for a way to establish dynamic travel routes based on current location/next destination.  Well, you're going to need an set of address fields, or a reference to an address record somewhere.  How do you capture this information?  For my company, we collate all Service Activities into Cases which represent the entire service event.  On it, I have custom address fields to represent the location at which service is being performed.  Now, if I had a way of identifying the "next" Case based on the current one, I could programmatically feed both addresses into Google Maps' API and show a driving route in an Iframe... but where to put the Iframe?  Perhaps the Case isn't the best place for it, but maybe it is--I could see using the SiteMap to establish a new area on CRM that uses some Javascript and SOAP calls to provide the determination, and interaction with GMaps.  Either way the list of considerations boils down to:

    1.) Where do you store the addresses?

    2.) How do you identify the next service location in relation to the current/last one?

    3.) Where do you display the directions?


    Dave Berry
    Monday, April 5, 2010 3:46 PM
    Moderator