I just had a client report that some posting security logic was no longer working after I updated a form. I traced it to the following code:
IF JobPostBypass THEN
BEGIN
IF UserPostVal2 THEN
BEGIN
CLEARALL;
SetJobPostBypass := TRUE;
JobPostBypass := TRUE;
UserPostVal2 := TRUE;
END
ELSE
BEGIN //JPB = TRUE, UPV = FALSE
CLEARALL;
SetJobPostBypass := TRUE;
JobPostBypass := TRUE;
END;
END
ELSE
BEGIN
IF UserPostVal2 THEN
BEGIN
CLEARALL;
UserPostVal2 := TRUE;
END
ELSE //BOTH ARE FALSE
CLEARALL;
END;
The problem was that the second test: IF UserPostVal2 THEN was always returning False even though the variable UserPostVal2 was True! I watched the value in the debugger which reported its value as Yes. I ended up having to create another variable to do the same task which worked. I've never seen Navision do this before. Kind of a bummer.
Comments
make absolutely sure it TRUE
http://www.BiloBeauty.com
http://www.autismspeaks.org
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But is there a field in this table or a function with the same name and Type / return Type?
Did you have test to change the name of the variable under your Globals? Can you compile or pops now up an error?
If no error pops up, then ther is a second variable, a field with the same name or a function with this name.
Cheers!
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Not for other functions with a VAR Table Parameter