A new knowledge base article has been published on our support portal.
When a customer purchases a product, that product should be shipped from the nearest supplier or warehouse for efficiency. In this article we show you how you can use a combination of North52 and Bing Maps Distance Matrix API to find the nearest supplier and associate it to a Quote line item when the Quote line item is being created.
North52 BPA Solution
The North52 BPA solution works like this:
- A Formula is set up on the Create and Update of a Quote Line Item which:
- Finds all Suppliers for the given product which have Latitude and Longitude coordinates
- Creates a JSON representation of the Customer and Suppliers in the format required by the Bing Maps Distance Matrix API
- Calls the Bing Maps Distance Matrix API using the CallRestAPI function
- Uses North52’s xCacheLoadLocal function to load the returned results into memory and sort them to find the nearest supplier
- Finally, it updates the Quote Line record with the closest supplier