I need to create one formula field or trigger where when user inserts country value or postal code value then field called "Time zone" should auto populate with the respective time zone of that country or postal code.
Your help would be greatly appreciated. Thanks in advance experts..!!
1 Antwort
This is a tough one but there are lots of posts out there.
I don't see how country value would determine time zone. If value is US, which time zone would it return? Postal code could be good way to find it but there are a lot.
Some of the posts I saw looked at phone number area code because there are fewer.
There may be some apps out there or a code based solution but my idea is to create a custom object where you maintain the time zone relationship. Using the phone number area code as an example you could enter all of the area codes (assuming this is US based only) and their associated time zone into the custom object table. From there use a method to retrieve the corresponding time zone for the matching area code (process builder, flow, formula, code...not sure), and update the time zone on the record you want.
I know it's not the answer, but it should get you started. Here are posts I found relevant.
https://help.salesforce.com/articleView?id=000220169&type=1
https://developer.salesforce.com/forums/?id=906F00000008vV7IAI
https://success.salesforce.com/answers?id=90630000000gjxbAAA