Re: Storing Dates and Times From Different Time Zones

2018-12-20 Thread Keisuke Miyako via 4D_Tech
this works for dates...but not very practical, obviously. C_DATE($d) C_TIME($t) $dbp:=Get database parameter(Dates inside objects) SET DATABASE PARAMETER(Dates inside objects;String type with time zone) $d:=JSON Parse("\""+$ISO+"\"";Is date) XML DECODE($ISO;$t) SET DATABASE PARAMETER(Dates

Re: Storing Dates and Times From Different Time Zones

2018-12-20 Thread Keisuke Miyako via 4D_Tech
oops! this works for the time but not the date! 2018/12/21 11:02、Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com>のメール: XML DECODE($ISO;$d) ** 4D Internet Users Group (4D iNUG) Archive:

Re: Storing Dates and Times From Different Time Zones

2018-12-20 Thread Keisuke Miyako via 4D_Tech
is this a competition? then here's my entry: $ISO:=String(Current date;ISO date GMT;Current time) C_DATE($d) C_TIME($t) XML DECODE($ISO;$d) XML DECODE($ISO;$t) ** 4D Internet Users Group (4D iNUG) Archive:

Re: WA Evaluate JavaScript in 16.4

2018-12-20 Thread Keisuke Miyako via 4D_Tech
originally designed as a "beginner language" JS has some tolerant syntax rules, being OK to omit the line terminator ";" is one of them. of course, this could only work if the end-of-line can be implied without a ";" (for example, by \n) I can understand the motivation to remove all \n from

Re: Where the f*** is the knowledge base hidden???

2018-12-20 Thread Keisuke Miyako via 4D_Tech
Evidently, this is standard Mac/Safari behaviour (HSTS). A system Daemon is telling Safari that all *.4d.com access should be forced https: regardless of what was entered in the address bar. (Chrome respects the address, but it will display a warning that the site is insecure).

RE: WritePro expression undefined

2018-12-20 Thread David Ringsmuth via 4D_Tech
John, We can manually limit the entry of commands and methods, since we control the UI that inserts expressions. It would be easier is the command SET ALLOWED METHODS did this for us automatically. Thanks for your help John! David Ringsmuth

Re: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
There is no such command SET ALLOWED COMMANDS, only SET ALLOWED METHODS which only works on methods. If you allow users to enter "QUERY" then they can also enter DELETE SELECTION. The documentation says: > If you would like the user to be able to call 4D commands that are > unauthorized by

RE: WritePro expression undefined

2018-12-20 Thread David Ringsmuth via 4D_Tech
John, We opened a case with 4D. WritePro optionally displays expressions, or their calculated values. We may have to parse the converted WritePro objects to replace queryies with a call formatted like: Query_ (->[Student];->[Student]AccountNo;"=";->[Account]AccountNo) …which does…

Re: WA Evaluate JavaScript in 16.4

2018-12-20 Thread Tom DeMeo via 4D_Tech
Hi, I would suggest constructing an HTML page and loading any javascript libraries you need into it. Then load that page into a web area on a form. That will allow you to use WA EXECUTE JAVASCRIPT FUNCTION instead to call the functions you need from your loaded page. If this has to occur on

Re: Storing Dates and Times From Different Time Zones

2018-12-20 Thread John DeSoi via 4D_Tech
I use the code below to determine the number of seconds offset from GMT for the current time zone. This could be added back to a GMT time stamp to get the local time. John DeSoi, Ph.D. C_LONGINT($0) C_DATE($zDate;$gmtDate) C_TIME($zTime;$gmtTime) C_TEXT($str) $zDate:=Current date

Re: Coding/Development Style Guide?

2018-12-20 Thread Comcast POP via 4D_Tech
Hi Garri, Thank’s for responding. I’m reasonably solid with variable/field naming, I think (at least once I get updated to include blobs and object types). As far as forms and method names go though, my approach developed organically over the years and really only applied to a single app so

Re: WA Evaluate JavaScript in 16.4

2018-12-20 Thread Noah via 4D_Tech
Thanks for the quick reply! We had constructed a minimal test: an external js file that contains *alert('hello')* on a single line and nothing else. We may have now narrowed the scope of this issue to WA Execute JavaScript's ability to handle the '\n' in the javascript that it reads from a file.

RE: Storing Dates and Times From Different Time Zones

2018-12-20 Thread Timothy Penner via 4D_Tech
Tech Tip: Convert ISO GMT date string to local time, date and ISO date string http://kb.4d.com/assetid=77110 -Tim -Original Message- From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Nate Rheaume via 4D_Tech Sent: Thursday, December 20, 2018 9:55 AM To: 4d_tech@lists.4d.com

Re: WA Evaluate JavaScript in 16.4

2018-12-20 Thread John DeSoi via 4D_Tech
Try turning 'Use embedded rendering engine' off for the web area. And verify your JavaScript code works outside of 4D in Safari when using Mojave. John DeSoi, Ph.D. > On Dec 20, 2018, at 11:10 AM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote: > > The parent form: > Case of >: (Form

Storing Dates and Times From Different Time Zones

2018-12-20 Thread Nate Rheaume via 4D_Tech
We have clients that are accessing the same server database from different time zones. We would like to store date/time using GMT and then display it in the users local time zone. Using the String command it's easy to convert to GMT but I'm not sure what the best way is the convert GMT back to

Re: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
I see two options: 1. Submit a bug/feature request to 4D and hope they change it to return nothing instead of "Undefined". 2. Replace all of your QUERY commands with a method that returns an empty string. I don't use 4D Write Pro, but I think automating the replacement in 4D Write before

WA Evaluate JavaScript in 16.4

2018-12-20 Thread Noah via 4D_Tech
Good morning! SUMMARY: In 16.4 (interpreted mode) we have a web area which displays a web page that is not under our control. We had devised a way to scrape the webpage with a custom library of JavaScript files that we kept in the resources folder. We find that in 16.4 the WA Evaluate JavaScript

RE: WritePro expression undefined

2018-12-20 Thread David Ringsmuth via 4D_Tech
John, WritePro documents may contain references to [Table]Field, which requires that the record be present during printing, which may require QUERY commands. The embedded QUERY commands work, execute properly in WritePro. But in place of the embedded expression is the value “Undefined”. We

Re: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
SET ALLOWED METHODS specifies project methods allowed, not 4D commands. So unless you named a project method the same as the 4D command QUERY, you are using it wrong. And the 4D command QUERY does not return a result, so I'm not sure how you would use that in an expression. Of course, you can

WritePro expression undefined

2018-12-20 Thread David Ringsmuth via 4D_Tech
4D v17.2.0.0 227919 R2 32bit or 64bit Windows 10 Home 1803 WP PRINT(Rpt_ob;wk 4D Write Pro layout) SET ALLOWED METHODS included “QUERY” 4D Query command expressions appear as “Undefined” in the printed document. The command appears successful. Please help! Thanks! David Ringsmuth