Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Reason for functionality:

Data is always useful. The more the better. (for the most part) Problem is when users create records, usually the minimum requirements is what is entered. They just want to get their job done, sale through etc. When possible.. supplementing some information could be very handy for reporting, tracking and quality reasons. 

High Level Requirements:

  • Process to supplement information from the custom object(s) or logged in user record
  • Apex Code that can be re-used on a per object basis, ie: we want to be able to leverage the code for any object’s apex trigger
  • Be able to activate/deactivate functionality

Details

How to supplement data

Overall requirements: 

  1. Calculation happens on create or update when certain fields below are changed
  2. Only fill in fields that are entered in as blank for inserts. 
  3. Only overwrite data when fields are changed in update.

1: Object 1
This object will hold the fields to fill in for this dependent picklist fields. 

  1. Region (picklist)
    1. ex: Americas
    2. APAC
  2. Country (picklist, dependent on Region)
    1. ex USA
    2. UK
  3. Territory (picklist, dependent on Country)
    1. ex: North
    2. South

Insert: If they provide Territory, we can find Country & Region. If they provide Country we can provide Region.

Update: Recheck if any fields change

2: Object 2
This object holds primary language and a flag icon per Country

  1. Country (picklist)
  2. Primary Language (picklist)
    1. ex: English
    2. French
  3. Flag Icon (image)
    1. ex: American Flag.gif
    2. French Flag.gif

This should display as an inline visualforce page 

*** We want a finite grouping of Countries with their flags.. provided at the bottom.

Insert: Only Country will be possibly provided: provide two other fields every time.
Update: Recheck if Country changes.

3: Timezone
Using Google APIs to fill in Timezone.. using Postal Code and Country Code

  • Timezone (picklist)

This be a special case where we will need the google api to grab by Postal Code/Latitude/Longitude

The Google APIs give a pretty good service to accomplish this. This method would be preferred as we only have to send the request and parse the response. 

Postal code Google API URL/example
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=12205

Timezone Google API URL/example
https://maps.googleapis.com/maps/api/timezone/json?parameters=42.6446929,-73.783968&timestamp=1331161200&sensor=false

We want Timezone to eventually come back in this format:

  • (GMT+08:00) Singapore Standard Time (Asia/Singapore)
  • (GMT+03:00) Eastern European Summer Time (Europe/Bucharest)
  • (GMT-05:00) Eastern Standard Time (America/Panama)

We only want to call these APIs when we actually will be filling in the timezone, not whenT displaying. Want to avoid unnecessary API calls.

Insert: When Postal Code and Country is entered, fill in Timezone
Update: Recheck if Postal Code/Country changes.

4: Logged in User fields  
After going through our config data we want to try to supplement data by using the logged in User’s data. Use this when:

  1. Only on insert when we try to fill in using the above rules but cannot.
  2. AND only on a manually created record. (so logged in user is possible)

Country picklist desired:

  1. USA
  2. Canada
  3. UK
  4. Australia
  5. India

Use these values for both Country fields and provide small icon flags for all five.

Mapping:

  1. Region
    1. Account.Region__c
    2. Lead.Region__c
  2. Country
    1. Account.Country__c
    2. Lead.Country__c
  3. Territory
    1. Account.Territory__c
    2. Lead.Territory__c
  4. Primary Language
    1. Contact.Primary_Language__c
    2. Lead.Language__c
  5. Flag Icon
    1. Account.Flag__c
    2. Lead.Flag__c
    3. Account.Flag__c


Final Submission Guidelines

Submission Deliverables
A complete list of deliverables can be found in the TopCoder Assembly competition Tutorial at:
http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials

  • Source code and configuration files.
  • Deployment guide to configure and verify the application.

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30039589