Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Date Formating - Error when null  (Read 13419 times)
Paul M.
Posts: 31


« on: July 17, 2014, 09:27:06 am »

Any suggestions on how to stop this error when I have a null date:

Code
  1. Premature end of file
  2. Cause:(GS-33927) Expression error: (GS-33936) Error executing RTL method "fromIsoValue" on object of type java.util.Date (cause=(GS-33968) Date.parseString(): Failed to parse date value "          " with pattern "YYYY-MM-DD") evaluating RTL expression "{Date.fromIsoValue(pr_header.date_deliver.isoValue).format("DD MMM YYYY")}"


Code
  1. <Item name="pr_header.date_deliver" type="DATE" isNull="1" value="          " isoValue="          " caption="Date Deliver"/>

My dates are formatted as
Code
  1. Date.fromIsoValue(pr_header.date_deliver.isoValue).format("DD MMM YYYY")




Thanks.


Using Genero 2.50


* Screenshot - Thu-17Jul14@0817.png (29.85 KB, 626x338 - viewed 2187 times.)
Romain W.
Four Js
Posts: 48


« Reply #1 on: July 18, 2014, 03:54:46 pm »

Hi Paul,

Try the following expression, that should work:
pr_header.date_deliver.isoValue.trim().isEmpty()?"<replacement_string>":Date.fromIsoValue(pr_header.date_deliver.isoValue).format("DD MMM YYYY"),
where <replacement_string> is a string of your choice (can be empty).

But normally, since version 2.50, you should be able to test the value of the variable with the 'isNull()' RTL function, but it doesn't seem to work (I made several tests on that, but always got the same error); we'll investigate on that.

Best regards,
Romain
Paul M.
Posts: 31


« Reply #2 on: July 29, 2014, 12:50:50 pm »

Thanks Romain.

I was trying the isnull() but it didn't seem to work so I thought I was doing something wrong.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines