Skip to content

Chapter 3: Configuring Custom Objects

Joseph Dindinger edited this page Dec 24, 2019 · 20 revisions

Configuring Custom Objects

Expanding Address Verification to Custom Areas

I

n this section you will learn to configure custom objects built within Salesforce CRM or any edition on the Salesforce platform. As with the steps for Standard Objects, we need to switch to the “Setup” area.

Creating Mandatory Fields

The following fields must be created for each object where you want to verify an address. If there is more than one address to verify, then one of these fields must be created for each address.

Sample Field Name Field Type Field Description
Street Text(255) Will typically already be created
City Text(128) Will typically already be created
State Text(20) Will typically already be created
Zip Code Text(20) Will typically already be created
Country Text(64) Will typically already be created
Address Verified Checkbox Used to determine if the address needs to be verified
Address Last Verified Date/Time Used to determine the last time the address was verified
Address Return Code Text(40) Used for a return value from the address verification. Return values are: Confirmed, Not Confirmed, Confirmed - By Dropping Secondary Info, Confirmed - Missing Secondary Info, or Not Submitted

Creating Optional Fields

Several other fields are not required, but recommended to be created for each address to be verified.

Sample Field Name Field Type Field Description
Street 2 Text(128) Sometimes used to include the second line of the address. If this is not present, then the second line of the address can be included in the “Street” field.
Address Status Formula (Text) Use the following formula (substituting XXX with the API name of the "address return code" field name): If ( XXX = "Confirmed", IMAGE("/img/msg_icons/confirm16.png", "Confirmed" ,16,16) & " Confirmed", If ( XXX = "Confirmed - By Dropping Secondary Info", IMAGE("/img/msg_icons/warning16.png", "Confirmed - By Dropping Secondary Info" ,16,16) & " Confirmed - By Dropping Secondary Info", If ( XXX = "Confirmed - Missing Secondary Info", IMAGE("/img/msg_icons/warning16.png", "Confirmed - Missing Secondary Info" ,16,16) & " Confirmed - Missing SecondaryInfo",If ( XXX = "Not Submitted", IMAGE("/img/msg_icons/error16.png", "Not Submitted" ,16,16) & " Not Submitted",If ( XXX = "Not Confirmed", IMAGE("/img/msg_icons/error16.png", "Not Confirmed" ,16,16) & " Not Confirmed", IMAGE("/img/msg_icons/info16.png", "Note Yet Verified" ,16,16) & " Not Yet Verified" ) ) ) ) )
Address Barcode Text(32) Shows the barcode returned on verification
Address Barcode Image Formula (Text) Use the following formula (substituting XXX with the API name of the "address barcode" field name): if ( not ( isblank ( XXX ) ), IMAGE("https://www.barcodesinc.com/generator/image.php?code=" + XXX + "&style=196&type=C128B&width=206&height=50&xres=1&font=3", "Address Barcode" ), "" )
Address County Text(64) Shows the county name returned on verification
Address County FIPs Code Text(32) Shows the FIPs code for the county returned on verification
Address Latitude Number (13, 5) Used for geocoding the Latitude of the address
Address Longitude Number (13, 5) Used for geocoding the longitude of the address.
Address Unit Text(64) Shows the Apartment, Suite or Unit included in the address on verification
Urbanization Text(64) Shows the urbanization information (for Puerto Rico) returned on address verification
Active? Checkbox Shows if the Post Office thinks this is an active address
Carrier Route Text(4) Post Office carrier route code
Congressional District Text(2) Code for the Congressional District in which the address is located.
Daylight Savings? Checkbox Shows if the address is in an area that uses daylight savings time.
Sample Field Name Field Type Field Description
Do Not Verify Checkbox Use this field to indicate that you do not want the address to be verified in the future. Used mostly for automated processes.
Footnotes Long Text Area Notes on the details of the verification
RDI Text(32) Shows the Residential Delivery Indicator from the Post Office.
Record Type Text(1) Shows the returned accuracy of the verification.
Record Type Description Formula (Text) If(Record_Type__c = "F", "Firm", If(Record_Type__c = "G", "General Delivery",If(Record_Type__c = "H", "High-Rise", If(Record_Type__c = "P", "P.O. Box", If(Record_Type__c = "R", "RuralRoute", If(Record_Type__c = "S", "Street", "" ) ) ) ) ) )
Time Zone Text(48) Shows the name of the time zone in which the address is located.
Vacant? Checkbox Shows if the Post Office believes this address to be vacant.
Clean Street Text(255) Used to copy a “clean” version of the street field. This is used in the feature that tries to auto-update previously verified addresses.
Verification Used Picklist Choices are: SmartyStreets, Google Maps, UPS
UTC Offset Number (16,2) Used to indicate how many hours different from GMT/UTC time
Current Time Formula (Text) For the code for this field, please see code on the next page. Note that you will need to set up the UTC Offset and the Daylight Savings? fields as described above.
Non-SmartyStreets Data
These fields are populated by sources outside of SmartyStreets and are not guaranteed to be 100% accurate. If these fields are critical for you, please contact us at support@toafinish.com to discuss sources and how often they are updated.
Island Text (200) This is for the name of the Island on which an address is located. Only the Hawaiian and both sets of Spanish islands are supported.
Area Codes Text(32) Phone area codes supported in this zip code
Urban Area Code Text (10) Code for the primary Urban Area for the zip code, sourced from the 2010 Census.
Urban Area Name Text (255) Primary Urban Area Name/Description for the Urban Area Code for the zip code. Must be used together with the Urban Area Code, as it is populated from the code.

Current Time Formula

To use this formula, please replace “HOUROFFSET” with the API name of the field containing the numeric offset from UTC official time, and “DAYLIGHTSAVINGS” with the checkbox field containing a TRUE or FALSE value for daylight savings. This formula will only work for time in the US.

IF(ISBLANK(HOUROFFSET), "",
  IF (AND( DAYLIGHTSAVINGS, 
        TODAY() >= 
        CASE(MOD(DATE(YEAR(TODAY()),3,8) - DATE(1900,1,7),7), 
        0, DATE(YEAR(TODAY()),3,8), 
        1, DATE(YEAR(TODAY()),3,8)+6, 
        2, DATE(YEAR(TODAY()),3,8)+5, 
        3, DATE(YEAR(TODAY()),3,8)+4, 
        4, DATE(YEAR(TODAY()),3,8)+3, 
        5, DATE(YEAR(TODAY()),3,8)+2, 
        DATE(YEAR(TODAY()),3,8)+1), 
        TODAY() <
        CASE(MOD(DATE(YEAR(TODAY()),11,1) - DATE(1900,1,7),7), 
        0, DATE(YEAR(TODAY()),11,1), 
        1, DATE(YEAR(TODAY()),11,1)+6, 
        2, DATE(YEAR(TODAY()),11,1)+5, 
        3, DATE(YEAR(TODAY()),11,1)+4, 
        4, DATE(YEAR(TODAY()),11,1)+3, 
        5, DATE(YEAR(TODAY()),11,1)+2, 
        DATE(YEAR(TODAY()),11,1)+1)),
    /* CALCULATE FOR IT BEING CURRENTLY DST */
    MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 6, 2 ) & "/" &
    MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 9, 2 ) & "/" &
    LEFT( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 4 ) & " " &
    TEXT(
      IF(
        OR(
          VALUE( MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 12, 2 ) ) = 0,
          VALUE( MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 12, 2 ) ) = 12), 12,
            VALUE( MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 12, 2 ) ) -
            IF( VALUE( MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 12, 2 ) ) < 12, 0, 12 )
      )
    )
    &":"& MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 15, 2 ) &" "&
    IF( VALUE( MID( TEXT( NOW()+ (HOUROFFSET +1) /24 ), 12, 2 ) ) < 12, "AM", "PM"
    ),
    /* CALCULATE FOR IT NOT BEING CURRENTLY DST */
    MID( TEXT( NOW()+ HOUROFFSET /24 ), 6, 2 ) & "/" &
    MID( TEXT( NOW()+ HOUROFFSET /24 ), 9, 2 ) & "/" &
    LEFT( TEXT( NOW()+ HOUROFFSET /24 ), 4 ) & " " &
    TEXT(
      IF(
        OR(
          VALUE( MID( TEXT( NOW()+ HOUROFFSET /24 ), 12, 2 ) ) = 0,
          VALUE( MID( TEXT( NOW()+ HOUROFFSET /24 ), 12, 2 ) ) = 12), 12,
            VALUE( MID( TEXT( NOW()+ HOUROFFSET /24 ), 12, 2 ) ) -
            IF( VALUE( MID( TEXT( NOW()+ HOUROFFSET /24 ), 12, 2 ) ) < 12, 0, 12 )
      )
    )
    &":"& MID( TEXT( NOW()+ HOUROFFSET /24 ), 15, 2 ) &" "&
    IF( VALUE( MID( TEXT( NOW()+ HOUROFFSET /24 ), 12, 2 ) ) < 12, "AM", "PM"
    )
  )
)

Creating International Fields

If you are going to be verifying international addresses, there are a few fields you should create if you want to have helpful data.

Sample Field Name Field Type Field Description
Address Precision Text (255) How precise is the address? From best to worst: ,DeliveryPoint — rooftop level,Premise ,property or building level,Thoroughfare — street level,Locality — city or town level,AdministrativeArea — state or province level,None — unknown address
Administrative Area Text (255) The most common administrative division within a country (e.g. Region)
Geocode Precision Text (255) How precise is the geocoding of the address? From best to worst: ,DeliveryPoint — rooftop level,Premise — property or building level,Thoroughfare — street level,Locality — city or town level
AdministrativeArea — state or province level,None — unknown address
Organization Text (255) The name of the recipient, firm, or company at this address
Premise Text (64) Alphanumeric code pertaining to an individual location
Premise Extra Text (64) Extra information about the premise that is not necessarily authoritative but might still be useful
Sub Building Number Text (64) The alphanumeric component of the sub_building
Sub Building Type Text (64) The leading sub-building type of the sub_building
Super Administrative Area Text (255) The largest administrative division within a country
Thoroughfare Name Text (255) The name component of the thoroughfare

Creating Custom Address Records

Every custom address to be verified must first be set up in the configuration page. Once in the setup page, click the “Manage Addresses” tab and then click the “New Address” button.

Clone this wiki locally