If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

BUG in code generation

This goes for version 7.01.0013 (possibly also for previous versions).

I have a grid with a date called DATE_FROM (see attachment 1)

This DATE_FROM is for storing a DATE type into a DATE field (see attachment 2).
The DATE_TO is a similar field, just another name.
On this field I have an Ajax Event

DATE_FROM_OnChange:

Code:

//the begin date must be <= end date
//sc_ajax_message('DATE_FROM_OnChange:'.{DATE_FROM}.' '.{DATE_TO},'Message');
if (!is_null({DATE_FROM}) && !is_null({DATE_TO})){
//datetime is a string in the yyyy-mm-dd formaat if I echo it
if ({DATE_FROM}>{DATE_TO})
sc_error_message('the begin date is past the end date. This is invalid');
}

When I show my grid and change the value in my DATE_FROM then even tho DATE_FROM<DATE_TO it still generates the sc_error_message!!!

When I use the following code (so with the red { and } ):

Code:

//the begin date must be <= end date
//sc_ajax_message('DATE_FROM_OnChange:'.{DATE_FROM}.' '.{DATE_TO},'Message');
if (!is_null({DATE_FROM}) && !is_null({DATE_TO})){
//datetime is a string in the yyyy-mm-dd formaat if I echo it
if ({DATE_FROM}>{DATE_TO}){
sc_error_message('the begin date is past the end date. This is invalid');
}
}

then it works fine!

When I view the generated code from the first one (with the red { and } ) on line 4715 then I get: