+ Start a Discussion
sashamsasham 

customer timezone in customer object

Hi 

We have custom Participant object and custom timezone field(pick list - cetral , eastern arizona and pacific ). for each particiipat , particiipant address (state and zip code) is stored in child object called participantdetail. 
when new participnat is created , how do i populate the time zone  field with thier timezone ( i have  the zip code in address  and is it possible to populate the timezone field using the zip code  ) or any other way.  . 
Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student

I think there are a few ways in which you can do this. It call comes down to what is easiest for you. You could store the values within a resource that you add to salesforce and then call upon. You could create an object that holds the information in a text field in which you deserialize. 

I am sure there would be some form of Jquery plugin that can acheive this through the internet, but you would run into issues call an api from within the page unless you give access. Either way, I would be googling some kind of jquery plugin, that you can upload to your static resource and use in your pages.

If it is a complete behind the scenes thing, that you need to do fully with apex, it appears salesforce has a timezone class that you should be able to leverage for your needs.

I have built a small timezone tool with australia post codes  before. I did it when slightly less experiences and it seemed to work. I created a picklist component that included that values of all the areas within australia and their respected tiemzone offsets. Then I just used the timezone class or (other jaavascript based scripts) to calculate the new time. Timezone is always fickle, so make sure you do plenty of testing, watch out for daylight savings too. You dont want time fields being out 1 whole hour.

All the best

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_timezone.htm

sashamsasham
Thank you for the information and the reply. i will ask more question when i will start develop.