- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2016 04:35 PM
We have a scheduled import, that imports user data from AD, whose source is SAP. The user timezone in the source, is set to MST, CST, EST etc. But this is causing us some issues with the time displayed for users and the records they create.
I would like to add a Transform Scrip to the Import to convert the Time Zones like below. Also, I havent tried this in the script below, but if the source is empty, can I use a javascript to set it to the system default?
Am I going about this the right way, or is there an easier alternative such as a BR? I appreciate (as always) any feedback.
Mark S.
--------------------------------------------------------------------------------------------------------------------------------
Header 1 |
---|
//convert time zones if (source.u_timezone == "MST"){ target.setDisplayValue('time_zone',"Canada/Mountain"); } if (source.u_timezone == "EST"){ target.setDisplayValue('time_zone',"Canada/Eastern"); } if (source.u_timezone == "PST"){ target.setDisplayValue('time_zone',"Canada/Pacific"); } if (source.u_timezone == "CET"){ target.setDisplayValue('time_zone',"Canada/Pacific"); } else if (source.u_timezone == ""){
ignore = true; } |
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2016 08:41 PM
Hello Michael, thanks for the reply. I think there may be a missing bracket from your solution. So to clarify, would:
if (source.u_timezone == "MST"){
target.setDisplayValue('time_zone',"Canada/Mountain");
become
if (source.u_timezone == "MST"){
target.time_zone == "Canada/Mountain";
or (as in your response) which has a closing ' ) ' , but no opening ' ( '.
if (source.u_timezone == "MST"){
target.time_zone == "Canada/Mountain");
Cheers, Mark S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2016 05:10 AM
Where? This one isn't mark anything yet, but moderators can help if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 09:08 AM
Thanks MIchael, I marked you answer correct, I ended up using:
//convert time zones.
if (source.u_timezone == "MST"){
target.time_zone = "Canada/Mountain";
} if (source.u_timezone == "PST"){
target.time_zone ="Canada/Pacific";
}if (source.u_timezone == "EST"){
target.time_zone = "Canada/Eastern";
}if (source.u_timezone == "NST"){
target.time_zone = "Canada/Atlantic";
} else if (source.u_timezone == ""){
ignore = true;
}