Hi friends,
I detected following code in our vertical solution (look at the ' '):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
' ': ... <<<===
ELSE ...
END;
This works perfectly with a NAV 5 Client (native database).
But if you upgrade the NAV 5 database to NAV 6 and do the same thing with a NAV 6 Client, then the result differs.
The ' ' (two blanks between the appostrophs) must be changed to '' (no blanks between the appostrophs):
CAG := "Customer Status" + "Address Class";
CASE CAG OF
'KA': ...
'KA': ...
'': ... <<<===
ELSE ...
END;
Otherwise a blank value will not be identified by the case and will go to the ELSE Statement.
Do you know the reason for that? Is NAV 6 checking a blank as SQL NULL value and a ' ' as an empty value???
For me it is strange, especially because it is a native database!
Thank you for your Information, Beno
0
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
@Rashed: Okay, so either I Change the program code to "" (no space between the two ") or I use "IF" instead "CASE"?
Thank you very much, Beno
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
thank you for the advice. But... UPPERCASE would only help, if it would be a textfield.
I would be astonished, if that would help in my case with blanks!?!
In my case it is a code field and contains values like 'AA', 'BB', 'CC' and as well blank.
The Problem is/was, that an empty field was compared with two blanks.
So instead of comparing it with "" it was compared with " " (two spaces in between).
NAV 2009 seems to make a difference between a compare with "" or a compayre with " ".
NAV 5.0 doesn't make a difference.
Best regards, Beno
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n