Custom functions with events and distances between UK postcodes
We require two custom functions to be written.
1) We require a function that will be actioned via a custom button. When clicked, a new window should pop up showing dates and times.
These dates and times are supposed to be the dates and times a sales person can attend a meeting with a prospect, based on logistical availability.
All sales people should have 4 customer meetings each day, usual meeting times are 10am, 12pm, 2pm and 4pm but these times can vary depending on customer availability.
We need this tool to read all our current calendar events location, date and time, then use the new lead postcode to find the nearest available slot and if possible taking into account traffic time.
2) We also require a function that creates an event each time a lead is converted to a potential sale.
The event must have a Subject in a specific format:
[POSTCODE] - [ACCOUNT NAME] - [CONTACT NAME] - [ACCOUNT OWNER]
It must map the date from the losing date and the time from a custom field named: "Appointment time"
Duration of events is always 2 hours.
The location of the event should pull the address from the lead that is being converted.
The description of the event must include the telephone number field followed by all current notes on the lead.