Scripting

  • 1.  Hi all - have a customer with salespersons that ha

    Posted 09-16-2016 10:33
    Hi all - have a customer with salespersons that have 75 mile radius sales territories. If a customer buys from their website, we need to check to see if the SO Ship to address is within 75 miles of any of the salesperson's office addresses. Anyone know of a gps distance solution /script? i'm thinking UDFS for lat/lng ship to values, a udt for the salesperson address coordinates then a report that gives only those within 75 miles? They want 'as the crow flies' not driving miles for the 75 radius. Any ideas?


  • 2.  RE: Hi all - have a customer with salespersons that ha

    Posted 09-16-2016 10:37
    xkZero has a route sales app. If they don't have something exactly right for this, they likely would know where to look.


  • 3.  RE: Hi all - have a customer with salespersons that ha

    Posted 09-16-2016 10:38
    This page has a javascript for calculating distance between to lat/long points. http://www.movable-type.co.uk/scripts/latlong.html


  • 4.  RE: Hi all - have a customer with salespersons that ha

    Posted 09-16-2016 10:51
      |   view attached
    @JerryNorman Is correct. We capture this information (attached) for route sales and deliveries using xkzero Mobile Commerce. Our development team could certainly help you - and @AlnoorCassim would be a great person to start with.


  • 5.  RE: Hi all - have a customer with salespersons that ha

    Posted 09-16-2016 13:37
    @MarcCregan xkzero Mobile Commerce (XMC) uses the Google Maps Distance API to calculate distance between 2 longitudinal / latitudinal points. If you want to access it as a Web Service where you send a JSON or XML file use this: https://developers.google.com/maps/documentation/distance-matrix/intro Otherwise if you want to access via the JavaScript API it's https://developers.google.com/maps/documentation/javascript/distancematrix For Google APIs you do have to sign-up for it and there is a Standard Plan vs Premium Plan and each has their daily limits on the number of requests you can send. Either that or you can try using the haversine formula directly to get the ""as the crow flies"" distance. Phil's link has that info in JavaScript.