Overview
Zip Code Functionality available in SalesPad Desktop will pull data to automatically complete a contact’s city and state once the zip code has been entered. Users can choose to pull data from Dynamics GP, Google, Bing, or from a locally stored table.
Setup
Using a locally stored table for Zip Code Functionality requires creating a custom stored procedure (spcpGetCustomZipInfo) onto the database which SalesPad will automatically call. We'll have an example spcpGetCustomZipInfo below (Contact Cavallo Support if you have questions regarding this process). Using Dynamics GP, Google, or Bing only requires selecting the correct option from the ZipCode Query Handlers setting in the Settings screen:

If using the Bing or Google ZIP APIs, an API key will need need to be entered into the Zip API Key setting seen below.
Custom Zip Code Query Handler Example
The following procedure is an example of a custom query for retrieving addresses from a custom table:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON GO
CREATE PROCEDURE [dbo].[spcpGetCustomZipInfo]
@zip AS CHAR(11) AS
BEGIN
DECLARE @zipCode INT; SET @zipCode = NULL;
IF (ISNUMERIC(@zip) = 1) BEGIN
SET @zipCode = CAST(substring(@zip,1,5) AS INT) --Cast first 5 digits as int END
IF (@zipCode IS NOT NULL) BEGIN
SELECT TOP 1
CITY, STATE, ZIP, COUNT(*) AS 'COUNT' FROM ZipCodes (NOLOCK)
WHERE ZIP = @zipCode GROUP BY CITY, STATE, ZIP
END END
GO
Usage
The Zip Code Functionality tool is available when a user is entering a new customer or contact in SalesPad. When the user is typing in the contact information and enters the zip code, SalesPad will automatically complete the Contact Address City and State.